more cherry-pick fix

This commit is contained in:
Nikolay Korolev 2021-08-03 22:20:14 +03:00
parent 6fbb7da82d
commit 80d00fe31a
2 changed files with 7 additions and 3 deletions

View File

@ -1049,7 +1049,7 @@ int8 CRunningScript::ProcessOneCommand()
#endif #endif
{ {
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT #ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
LogAfterProcessingCommand(command); LogAfterProcessingCommand(command);
#elif defined USE_BASIC_SCRIPT_DEBUG_OUTPUT #elif defined USE_BASIC_SCRIPT_DEBUG_OUTPUT
if (m_bMissionFlag) { if (m_bMissionFlag) {
char tmp[128]; char tmp[128];

View File

@ -4,10 +4,11 @@
#include "ScriptCommands.h" #include "ScriptCommands.h"
#include "Debug.h" #include "Debug.h"
#include "FileMgr.h"
#include "GameLogic.h"
#ifdef MISSION_REPLAY #ifdef MISSION_REPLAY
#include "GenericGameStorage.h" #include "GenericGameStorage.h"
#endif #endif
#include "FileMgr.h"
#include "Messages.h" #include "Messages.h"
#include "Timer.h" #include "Timer.h"
#include "Stats.h" #include "Stats.h"
@ -1728,6 +1729,9 @@ CTheScripts::SwitchToMission(int32 mission)
CMessages::ClearMessages(); CMessages::ClearMessages();
} }
if (CTheScripts::NumberOfExclusiveMissionScripts > 0 && mission <= UINT16_MAX - 2)
return;
#ifdef MISSION_REPLAY #ifdef MISSION_REPLAY
missionRetryScriptIndex = mission; missionRetryScriptIndex = mission;
#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT #ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT
@ -1738,7 +1742,6 @@ CTheScripts::SwitchToMission(int32 mission)
#endif #endif
CTimer::Suspend(); CTimer::Suspend();
int offset = CTheScripts::MultiScriptArray[mission]; int offset = CTheScripts::MultiScriptArray[mission];
CFileMgr::ChangeDir("\\");
#ifdef USE_DEBUG_SCRIPT_LOADER #ifdef USE_DEBUG_SCRIPT_LOADER
CFileMgr::ChangeDir("\\data\\"); CFileMgr::ChangeDir("\\data\\");
int handle = CFileMgr::OpenFile(scriptfile, "rb"); int handle = CFileMgr::OpenFile(scriptfile, "rb");
@ -1755,5 +1758,6 @@ CTheScripts::SwitchToMission(int32 mission)
pMissionScript->m_bIsMissionScript = true; pMissionScript->m_bIsMissionScript = true;
pMissionScript->m_bMissionFlag = true; pMissionScript->m_bMissionFlag = true;
CTheScripts::bAlreadyRunningAMissionScript = true; CTheScripts::bAlreadyRunningAMissionScript = true;
CGameLogic::ClearShortCut();
} }
#endif #endif