From 5c4fc9471ad01c292629b3119045893970cae79e Mon Sep 17 00:00:00 2001 From: def Date: Tue, 5 Jan 2021 19:09:29 +0100 Subject: [PATCH] Fix server crash with too many items (fixes #3477) --- src/game/server/player.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index d290d1f92..7e283f896 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -404,6 +404,8 @@ void CPlayer::Snap(int SnappingClient) GameServer()->m_apPlayers[SnappingClient]->m_TimerType == TIMERTYPE_SIXUP) { protocol7::CNetObj_PlayerInfoRace *pRaceInfo = static_cast(Server()->SnapNewItem(-protocol7::NETOBJTYPE_PLAYERINFORACE, id, sizeof(protocol7::CNetObj_PlayerInfoRace))); + if(!pRaceInfo) + return; pRaceInfo->m_RaceStartTick = m_pCharacter->m_StartTime; } @@ -418,6 +420,9 @@ void CPlayer::Snap(int SnappingClient) if(ShowSpec) { CNetObj_SpecChar *pSpecChar = static_cast(Server()->SnapNewItem(NETOBJTYPE_SPECCHAR, id, sizeof(CNetObj_SpecChar))); + if(!pSpecChar) + return; + pSpecChar->m_X = m_pCharacter->Core()->m_Pos.x; pSpecChar->m_Y = m_pCharacter->Core()->m_Pos.y; }