Fix incorrect sixup detection when snapping pickups

For 0.7 clients the client version is not `VERSION_NONE`, so `IsSixup` was never called for them, which leads to version 0.6 pickups being snapped for 0.7 clients. This causes snapshot CRC errors for the 0.7 clients, as the 0.6 and 0.7 pickup structs have different sizes.

Now the version is no longer checked before calling `IsSixup`, which is the case in all other locations where the function is called and was also the case before this bug was introduced by #6330.
This commit is contained in:
Robert Müller 2023-03-20 19:01:44 +01:00
parent 8d5ee109c7
commit a4b489aa87

View file

@ -173,7 +173,7 @@ void CPickup::Snap(int SnappingClient)
pChar = GameServer()->GetPlayerChar(GameServer()->m_apPlayers[SnappingClient]->m_SpectatorID); pChar = GameServer()->GetPlayerChar(GameServer()->m_apPlayers[SnappingClient]->m_SpectatorID);
int SnappingClientVersion = GameServer()->GetClientVersion(SnappingClient); int SnappingClientVersion = GameServer()->GetClientVersion(SnappingClient);
bool Sixup = SnappingClientVersion == VERSION_NONE ? Server()->IsSixup(SnappingClient) : false; bool Sixup = Server()->IsSixup(SnappingClient);
CNetObj_EntityEx *pEntData = 0; CNetObj_EntityEx *pEntData = 0;
if(SnappingClientVersion >= VERSION_DDNET_SWITCH && (m_Layer == LAYER_SWITCH || length(m_Core) > 0)) if(SnappingClientVersion >= VERSION_DDNET_SWITCH && (m_Layer == LAYER_SWITCH || length(m_Core) > 0))