MRMJ-1: Messenger & Skills fixes

This commit is contained in:
Mind Rapist
2025-12-14 06:40:27 +02:00
parent 0f79d890ba
commit 57db6f3ef6
4 changed files with 0 additions and 89 deletions

View File

@@ -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

View File

@@ -522,17 +522,10 @@ class CHARACTER : public CEntity, public CFSM, public CHorseRider
CStateTemplate<CHARACTER> m_stateMove;
CStateTemplate<CHARACTER> m_stateBattle;
CStateTemplate<CHARACTER> m_stateIdle;
#ifdef FIX_POS_SYNC
CStateTemplate<CHARACTER> 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();

View File

@@ -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);

View File

@@ -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,