Skip to content

Commit

Permalink
Fix the BitStream version mistake made in #3863 (#3866)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico8340 authored Nov 22, 2024
1 parent 6683086 commit 514a3b3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
8 changes: 6 additions & 2 deletions Client/mods/deathmatch/logic/rpc/CWorldRPCs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,12 @@ void CWorldRPCs::SetSyncIntervals(NetBitStreamInterface& bitStream)
bitStream.Read(g_TickRateSettings.iObjectSync);
bitStream.Read(g_TickRateSettings.iKeySyncRotation);
bitStream.Read(g_TickRateSettings.iKeySyncAnalogMove);
bitStream.Read(g_TickRateSettings.iPedSyncerDistance);
bitStream.Read(g_TickRateSettings.iUnoccupiedVehicleSyncerDistance);

if (bitStream.Can(eBitStreamVersion::FixSyncerDistance))
{
bitStream.Read(g_TickRateSettings.iPedSyncerDistance);
bitStream.Read(g_TickRateSettings.iUnoccupiedVehicleSyncerDistance);
}
}

void CWorldRPCs::SetMoonSize(NetBitStreamInterface& bitStream)
Expand Down
9 changes: 7 additions & 2 deletions Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10861,8 +10861,13 @@ bool CStaticFunctionDefinitions::SendSyncIntervals(CPlayer* pPlayer)
BitStream.pBitStream->Write(g_TickRateSettings.iObjectSync);
BitStream.pBitStream->Write(g_TickRateSettings.iKeySyncRotation);
BitStream.pBitStream->Write(g_TickRateSettings.iKeySyncAnalogMove);
BitStream.pBitStream->Write(g_TickRateSettings.iPedSyncerDistance);
BitStream.pBitStream->Write(g_TickRateSettings.iUnoccupiedVehicleSyncerDistance);

if (pPlayer->CanBitStream(eBitStreamVersion::FixSyncerDistance))

This comment has been minimized.

Copy link
@TheNormalnij

TheNormalnij Dec 13, 2024

Member

pPlayer can be null here

This comment has been minimized.

Copy link
@Nico8340

Nico8340 Dec 14, 2024

Author Contributor

Mistake, thanks for telling me

{
BitStream.pBitStream->Write(g_TickRateSettings.iPedSyncerDistance);
BitStream.pBitStream->Write(g_TickRateSettings.iUnoccupiedVehicleSyncerDistance);
}

if (pPlayer)
pPlayer->Send(CLuaPacket(SET_SYNC_INTERVALS, *BitStream.pBitStream));
else
Expand Down
4 changes: 4 additions & 0 deletions Shared/sdk/net/bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,10 @@ enum class eBitStreamVersion : unsigned short
// 2024-11-07
WorldSpecialProperty_IgnoreFireState,

// Fix iPedSyncerDistance and iUnoccupiedVehicleSyncerDistance sync
// 2024-11-22
FixSyncerDistance,

// This allows us to automatically increment the BitStreamVersion when things are added to this enum.
// Make sure you only add things above this comment.
Next,
Expand Down

0 comments on commit 514a3b3

Please sign in to comment.