Fix crash after exiting a code battle
parent
08d87fa975
commit
7216d8d12e
|
@ -2548,30 +2548,30 @@ bool CRobotMain::EventFrame(const Event &event)
|
||||||
m_eventQueue->AddEvent(Event(EVENT_LOST));
|
m_eventQueue->AddEvent(Event(EVENT_LOST));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (GetMissionType() == MISSION_CODE_BATTLE)
|
if (GetMissionType() == MISSION_CODE_BATTLE)
|
||||||
{
|
|
||||||
if (!m_codeBattleInit)
|
|
||||||
{
|
{
|
||||||
// NOTE: It's important to do this AFTER the first update event finished processing
|
if (!m_codeBattleInit)
|
||||||
// because otherwise all robot parts are misplaced
|
{
|
||||||
m_userPause = m_pause->ActivatePause(PAUSE_ENGINE);
|
// NOTE: It's important to do this AFTER the first update event finished processing
|
||||||
m_codeBattleInit = true; // Will start on resume
|
// because otherwise all robot parts are misplaced
|
||||||
|
m_userPause = m_pause->ActivatePause(PAUSE_ENGINE);
|
||||||
|
m_codeBattleInit = true; // Will start on resume
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_codeBattleStarted && m_userPause == nullptr)
|
||||||
|
{
|
||||||
|
m_codeBattleStarted = true;
|
||||||
|
ApplyCodeBattleInterface();
|
||||||
|
CreateCodeBattleInterface();
|
||||||
|
|
||||||
|
SetCodeBattleSpectatorMode(true);
|
||||||
|
|
||||||
|
m_eventQueue->AddEvent(Event(EVENT_UPDINTERFACE));
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateCodeBattleInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_codeBattleStarted && m_userPause == nullptr)
|
|
||||||
{
|
|
||||||
m_codeBattleStarted = true;
|
|
||||||
ApplyCodeBattleInterface();
|
|
||||||
CreateCodeBattleInterface();
|
|
||||||
|
|
||||||
SetCodeBattleSpectatorMode(true);
|
|
||||||
|
|
||||||
m_eventQueue->AddEvent(Event(EVENT_UPDINTERFACE));
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateCodeBattleInterface();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue