Fix crash on invalid pause state in save

This commit is contained in:
Dennis Felsing 2017-05-16 17:02:28 +02:00
parent 74e19b26a7
commit 666d1585b7
2 changed files with 4 additions and 2 deletions

View file

@ -665,7 +665,9 @@ void CPlayer::ProcessPause()
int CPlayer::Pause(int State, bool Force) 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) if(!m_pCharacter)
return 0; return 0;

View file

@ -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)); str_copy(m_name, pChr->m_pPlayer->Server()->ClientName(pChr->m_pPlayer->GetCID()), sizeof(m_name));
m_Alive = pChr->m_Alive; m_Alive = pChr->m_Alive;
m_Paused = pChr->m_pPlayer->IsPaused(); m_Paused = abs(pChr->m_pPlayer->IsPaused());
m_NeededFaketuning = pChr->m_NeededFaketuning; m_NeededFaketuning = pChr->m_NeededFaketuning;
m_TeeFinished = pChr->Teams()->TeeFinished(pChr->m_pPlayer->GetCID()); m_TeeFinished = pChr->Teams()->TeeFinished(pChr->m_pPlayer->GetCID());