Fix for issues #486 and #487

master
Tomasz Kapuściński 2015-06-27 18:06:49 +02:00
parent 78e09c757d
commit 1ccb807091
1 changed files with 15 additions and 9 deletions

View File

@ -2761,15 +2761,21 @@ bool CRobotMain::EventFrame(const Event &event)
} }
} }
if(!m_codeBattleInit) { if (GetMissionType() == MISSION_CODE_BATTLE)
// NOTE: It's important to do this AFTER the first update event finished processing {
// because otherwise all robot parts are misplaced if (!m_codeBattleInit)
ChangePause(PAUSE_USER); {
m_codeBattleInit = true; // Will start on resume // NOTE: It's important to do this AFTER the first update event finished processing
} // because otherwise all robot parts are misplaced
if(!m_codeBattleStarted && m_pause->GetPause() == PAUSE_NONE) { ChangePause(PAUSE_USER);
m_codeBattleStarted = true; m_codeBattleInit = true; // Will start on resume
m_eventQueue->AddEvent(Event(EVENT_UPDINTERFACE)); }
if (!m_codeBattleStarted && m_pause->GetPause() == PAUSE_NONE)
{
m_codeBattleStarted = true;
m_eventQueue->AddEvent(Event(EVENT_UPDINTERFACE));
}
} }
return true; return true;