summaryrefslogtreecommitdiffstats
path: root/src/control/ScriptDebug.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-08-03 21:20:14 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2021-08-07 19:40:27 +0200
commit2672504e8a31898ce8e86375bb8f8912ac425290 (patch)
tree41aac8f990e36b9607ad3a52ec4135a48091912b /src/control/ScriptDebug.cpp
parentcherrypick fixes (diff)
downloadre3-2672504e8a31898ce8e86375bb8f8912ac425290.tar
re3-2672504e8a31898ce8e86375bb8f8912ac425290.tar.gz
re3-2672504e8a31898ce8e86375bb8f8912ac425290.tar.bz2
re3-2672504e8a31898ce8e86375bb8f8912ac425290.tar.lz
re3-2672504e8a31898ce8e86375bb8f8912ac425290.tar.xz
re3-2672504e8a31898ce8e86375bb8f8912ac425290.tar.zst
re3-2672504e8a31898ce8e86375bb8f8912ac425290.zip
Diffstat (limited to '')
-rw-r--r--src/control/ScriptDebug.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/control/ScriptDebug.cpp b/src/control/ScriptDebug.cpp
index 325575d9..bb0cfd45 100644
--- a/src/control/ScriptDebug.cpp
+++ b/src/control/ScriptDebug.cpp
@@ -4,10 +4,11 @@
#include "ScriptCommands.h"
#include "Debug.h"
+#include "FileMgr.h"
+#include "GameLogic.h"
#ifdef MISSION_REPLAY
#include "GenericGameStorage.h"
#endif
-#include "FileMgr.h"
#include "Messages.h"
#include "Timer.h"
#include "Stats.h"
@@ -1969,6 +1970,9 @@ CTheScripts::SwitchToMission(int32 mission)
CMessages::ClearMessages();
}
+ if (CTheScripts::NumberOfExclusiveMissionScripts > 0 && mission <= UINT16_MAX - 2)
+ return;
+
#ifdef MISSION_REPLAY
missionRetryScriptIndex = mission;
#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
@@ -1979,7 +1983,6 @@ CTheScripts::SwitchToMission(int32 mission)
#endif
CTimer::Suspend();
int offset = CTheScripts::MultiScriptArray[mission];
- CFileMgr::ChangeDir("\\");
#ifdef USE_DEBUG_SCRIPT_LOADER
CFileMgr::ChangeDir("\\data\\");
int handle = CFileMgr::OpenFile(scriptfile, "rb");
@@ -1996,5 +1999,6 @@ CTheScripts::SwitchToMission(int32 mission)
pMissionScript->m_bIsMissionScript = true;
pMissionScript->m_bMissionFlag = true;
CTheScripts::bAlreadyRunningAMissionScript = true;
+ CGameLogic::ClearShortCut();
}
#endif