From 666d1585b7fd31ba864fcb6877285480f4936405 Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Tue, 16 May 2017 17:02:28 +0200 Subject: [PATCH] Fix crash on invalid pause state in save --- src/game/server/player.cpp | 4 +++- src/game/server/save.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index ec2566eed..5d01c0bbc 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -665,7 +665,9 @@ void CPlayer::ProcessPause() int CPlayer::Pause(int State, bool Force) { - dbg_assert(State >= PAUSE_NONE && State <= PAUSE_SPEC, "invalid pause state passed"); + if(State >= PAUSE_NONE && State <= PAUSE_SPEC) // Invalid pause state passed + return 0; + if(!m_pCharacter) return 0; diff --git a/src/game/server/save.cpp b/src/game/server/save.cpp index def7c9d3b..4001b3cc1 100644 --- a/src/game/server/save.cpp +++ b/src/game/server/save.cpp @@ -22,7 +22,7 @@ void CSaveTee::save(CCharacter *pChr) str_copy(m_name, pChr->m_pPlayer->Server()->ClientName(pChr->m_pPlayer->GetCID()), sizeof(m_name)); m_Alive = pChr->m_Alive; - m_Paused = pChr->m_pPlayer->IsPaused(); + m_Paused = abs(pChr->m_pPlayer->IsPaused()); m_NeededFaketuning = pChr->m_NeededFaketuning; m_TeeFinished = pChr->Teams()->TeeFinished(pChr->m_pPlayer->GetCID());