From 1ccb807091910a8fdf536cb572676b726a884e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Sat, 27 Jun 2015 18:06:49 +0200 Subject: [PATCH] Fix for issues #486 and #487 --- src/object/robotmain.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index ff90739e..cafd3cf4 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -2761,15 +2761,21 @@ bool CRobotMain::EventFrame(const Event &event) } } - if(!m_codeBattleInit) { - // NOTE: It's important to do this AFTER the first update event finished processing - // because otherwise all robot parts are misplaced - ChangePause(PAUSE_USER); - m_codeBattleInit = true; // Will start on resume - } - if(!m_codeBattleStarted && m_pause->GetPause() == PAUSE_NONE) { - m_codeBattleStarted = true; - m_eventQueue->AddEvent(Event(EVENT_UPDINTERFACE)); + if (GetMissionType() == MISSION_CODE_BATTLE) + { + if (!m_codeBattleInit) + { + // NOTE: It's important to do this AFTER the first update event finished processing + // because otherwise all robot parts are misplaced + ChangePause(PAUSE_USER); + m_codeBattleInit = true; // Will start on resume + } + + if (!m_codeBattleStarted && m_pause->GetPause() == PAUSE_NONE) + { + m_codeBattleStarted = true; + m_eventQueue->AddEvent(Event(EVENT_UPDINTERFACE)); + } } return true;