mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Fix crash on invalid pause state in save
This commit is contained in:
parent
74e19b26a7
commit
666d1585b7
|
@ -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;
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue