From 57db6f3ef6553ce031e87d4af1b83584b9e27339 Mon Sep 17 00:00:00 2001 From: Mind Rapist Date: Sun, 14 Dec 2025 06:40:27 +0200 Subject: [PATCH] MRMJ-1: Messenger & Skills fixes --- src/common/service.h | 1 - src/game/char.h | 7 ------ src/game/char_state.cpp | 51 ----------------------------------------- src/game/packet.h | 30 ------------------------ 4 files changed, 89 deletions(-) diff --git a/src/common/service.h b/src/common/service.h index 37df8a0..d6236ec 100644 --- a/src/common/service.h +++ b/src/common/service.h @@ -15,6 +15,5 @@ #define CROSS_CHANNEL_FRIEND_REQUEST // Allow friend requests across different channels #define FIX_REFRESH_SKILL_COOLDOWN // Fix cooldown display time on skill slots #define FIX_BOOK_READING_FOR_MAX_LEVEL // Disable experience point deduction for reading a book when in max level -//#define FIX_POS_SYNC // Fix position synching between clients #endif diff --git a/src/game/char.h b/src/game/char.h index 3417bbe..21b7128 100644 --- a/src/game/char.h +++ b/src/game/char.h @@ -522,17 +522,10 @@ class CHARACTER : public CEntity, public CFSM, public CHorseRider CStateTemplate m_stateMove; CStateTemplate m_stateBattle; CStateTemplate m_stateIdle; -#ifdef FIX_POS_SYNC - CStateTemplate m_stateSyncing; -#endif public: virtual void StateMove(); virtual void StateBattle(); -#ifdef FIX_POS_SYNC - virtual void StateSyncing(); - virtual bool BlendSync(long x, long y, unsigned int unDuration); -#endif virtual void StateIdle(); virtual void StateFlag(); virtual void StateFlagBase(); diff --git a/src/game/char_state.cpp b/src/game/char_state.cpp index e41fd1e..57f17b2 100644 --- a/src/game/char_state.cpp +++ b/src/game/char_state.cpp @@ -1126,57 +1126,6 @@ void CHARACTER::StateBattle() } } -#ifdef FIX_POS_SYNC -void CHARACTER::StateSyncing() -{ - if (IsStone() || IsDoor()) { - StopConcurrentState(); - - return; - } - - DWORD dwElapsedTime = get_dword_time() - m_dwSyncStartTime; - float fRate = (float)dwElapsedTime / (float)m_dwSyncDuration; - - if (fRate > 1.0f) - fRate = 1.0f; - - int x = (int)((float)(m_posDest.x - m_posStart.x) * fRate + m_posStart.x); - int y = (int)((float)(m_posDest.y - m_posStart.y) * fRate + m_posStart.y); - - - Sync(x, y); - - if (1.0f == fRate) - { - StopConcurrentState(); - } -} - -/////////////////// -////// To use to gradually "move" the entity on the desired position while it can do whatever it wants (to use when receiving HEADER_CG_ATTACK) -bool CHARACTER::BlendSync(long x, long y, unsigned int unDuration) -{ - // TODO distance check required - // No need to go the same side as the position (automatic success) - if (GetX() == x && GetY() == y) - return false; - - m_posDest.x = m_posStart.x = GetX(); - m_posDest.y = m_posStart.y = GetY(); - - m_posDest.x = x; - m_posDest.y = y; - - m_dwSyncStartTime = get_dword_time(); - m_dwSyncDuration = unDuration; - m_dwStateDuration = 1; - - ConcurrentState(m_stateSyncing); - return true; -} -#endif - void CHARACTER::StateFlag() { m_dwStateDuration = (DWORD) PASSES_PER_SEC(0.5); diff --git a/src/game/packet.h b/src/game/packet.h index 26912c0..e842d21 100644 --- a/src/game/packet.h +++ b/src/game/packet.h @@ -603,38 +603,8 @@ typedef struct command_attack uint32_t dwVID; uint8_t bCRCMagicCubeProcPiece; uint8_t bCRCMagicCubeFilePiece; -#ifdef FIX_POS_SYNC - BOOL bPacket; - LONG lSX; - LONG lSY; - LONG lX; - LONG lY; - float fSyncDestX; - float fSyncDestY; - DWORD dwBlendDuration; - DWORD dwComboMotion; - DWORD dwTime; -#endif } TPacketCGAttack; -#ifdef FIX_POS_SYNC -typedef struct packet_attack -{ - BYTE bHeader; - BYTE bType; - DWORD dwAttacakerVID; - DWORD dwVID; - BOOL bPacket; - LONG lSX; - LONG lSY; - LONG lX; - LONG lY; - float fSyncDestX; - float fSyncDestY; - DWORD dwBlendDuration; -} TPacketGCAttack; -#endif - enum EMoveFuncType { FUNC_WAIT,