mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Check for null. Fix #4090
This commit is contained in:
parent
3594d89f85
commit
a9c11d07b3
|
@ -1246,10 +1246,12 @@ void CCharacter::Snap(int SnappingClient)
|
|||
|
||||
SnapCharacter(SnappingClient, ID);
|
||||
|
||||
CNetObj_SwitchState *pSwitchState = static_cast<CNetObj_SwitchState *>(Server()->SnapNewItem(NETOBJTYPE_SWITCHSTATE, ID, sizeof(CNetObj_SwitchState)));
|
||||
|
||||
if(pSwitchState)
|
||||
if(GameServer()->Collision()->m_pSwitchers)
|
||||
{
|
||||
CNetObj_SwitchState *pSwitchState = static_cast<CNetObj_SwitchState *>(Server()->SnapNewItem(NETOBJTYPE_SWITCHSTATE, ID, sizeof(CNetObj_SwitchState)));
|
||||
if(!pSwitchState)
|
||||
return;
|
||||
|
||||
pSwitchState->m_NumSwitchers = GameServer()->Collision()->m_NumSwitchers;
|
||||
|
||||
if(pSwitchState->m_NumSwitchers > 256)
|
||||
|
|
Loading…
Reference in a new issue