[server] Implement/match CPlayer::ToggleRaceCheckpoint(...)

This commit is contained in:
RD42 2024-09-16 23:46:53 +08:00
parent 9dfa35f439
commit e45235b6cf
2 changed files with 31 additions and 2 deletions

View File

@ -59,3 +59,27 @@ void CPlayer::ToggleCheckpoint(BOOL bEnabled)
//----------------------------------------------------
void CPlayer::ToggleRaceCheckpoint(BOOL bEnabled)
{
m_bRaceCheckpointEnabled = bEnabled;
m_bInRaceCheckpoint = FALSE;
RakNet::BitStream bsParams;
if (bEnabled)
{
bsParams.Write(m_byteRaceCheckpointType);
bsParams.Write(m_vecRaceCheckpoint.X);
bsParams.Write(m_vecRaceCheckpoint.Y);
bsParams.Write(m_vecRaceCheckpoint.Z);
bsParams.Write(m_vecRaceNextCheckpoint.X);
bsParams.Write(m_vecRaceNextCheckpoint.Y);
bsParams.Write(m_vecRaceNextCheckpoint.Z);
bsParams.Write(m_fRaceCheckpointSize);
pNetGame->SendToPlayer(RPC_SetRaceCheckpoint, &bsParams, m_PlayerID, 2);
} else {
pNetGame->SendToPlayer(RPC_DisableRaceCheckpoint, &bsParams, m_PlayerID, 2);
}
}
//----------------------------------------------------

View File

@ -153,7 +153,11 @@ public:
float m_fCheckpointSize;
BOOL m_bInCheckpoint;
char _pad2BBE[33];
VECTOR m_vecRaceCheckpoint;
VECTOR m_vecRaceNextCheckpoint;
BYTE m_byteRaceCheckpointType;
float m_fRaceCheckpointSize;
BOOL m_bInRaceCheckpoint;
int field_2BDF;
short field_2BE3[11];
@ -166,7 +170,7 @@ public:
short field_2C32;
int field_2C34;
BOOL m_bCheckpointEnabled;
int field_2C3C;
BOOL m_bRaceCheckpointEnabled;
int field_2C40;
// Weapon data
@ -201,6 +205,7 @@ public:
void SetCheckpoint(float fX, float fY, float fZ, float fSize);
void ToggleCheckpoint(BOOL bEnabled);
void ToggleRaceCheckpoint(BOOL bEnabled);
};
//----------------------------------------------------