Fixed lockups when calling StartSuspend multiple times

master
krzys-h 2016-07-04 17:02:39 +02:00
parent fb3245977c
commit 6f412df232
1 changed files with 7 additions and 2 deletions

View File

@ -1554,7 +1554,9 @@ char* CRobotMain::GetDisplayInfoName(int index)
//! Beginning of a dialogue during the game //! Beginning of a dialogue during the game
void CRobotMain::StartSuspend() void CRobotMain::StartSuspend()
{ {
if (m_suspend != nullptr) return; // already suspended
if (!IsPhaseWithWorld(m_phase)) return; if (!IsPhaseWithWorld(m_phase)) return;
GetLogger()->Info("Start suspend\n");
m_sound->MuteAll(true); m_sound->MuteAll(true);
ClearInterface(); ClearInterface();
@ -1572,6 +1574,9 @@ void CRobotMain::StartSuspend()
//! End of dialogue during the game //! End of dialogue during the game
void CRobotMain::StopSuspend() void CRobotMain::StopSuspend()
{ {
if (m_suspend == nullptr) return; // not suspended
GetLogger()->Info("Stop suspend\n");
m_sound->MuteAll(false); m_sound->MuteAll(false);
ClearInterface(); ClearInterface();
m_pause->DeactivatePause(m_suspend); m_pause->DeactivatePause(m_suspend);