diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2021-08-03 22:14:58 +0300 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2021-08-03 22:14:58 +0300 |
commit | 6fbb7da82da720d5bb3ed474d2dc77c8913bea50 (patch) | |
tree | 562f9c4d4dcbe566a6814d8a1b167c06ba469bd1 /src/control | |
parent | 5a22896197f84939616393b09145d8602ccbad3e (diff) |
cherrypick fixes
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/Script.h | 4 | ||||
-rw-r--r-- | src/control/ScriptDebug.cpp | 27 |
2 files changed, 17 insertions, 14 deletions
diff --git a/src/control/Script.h b/src/control/Script.h index 44e69016..4e443727 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -47,6 +47,10 @@ void FlushLog(); #define KEY_LENGTH_IN_SCRIPT (8) +#ifdef USE_DEBUG_SCRIPT_LOADER +extern const char* scriptfile; +#endif + //#define GTA_SCRIPT_COLLECTIVE struct intro_script_rectangle diff --git a/src/control/ScriptDebug.cpp b/src/control/ScriptDebug.cpp index e202588f..9e880b5e 100644 --- a/src/control/ScriptDebug.cpp +++ b/src/control/ScriptDebug.cpp @@ -4,6 +4,9 @@ #include "ScriptCommands.h" #include "Debug.h" +#ifdef MISSION_REPLAY +#include "GenericGameStorage.h" +#endif #include "FileMgr.h" #include "Messages.h" #include "Timer.h" @@ -1531,6 +1534,7 @@ void FlushLog() #endif } +#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT int CRunningScript::CollectParameterForDebug(char* buf, bool& var) { uint16 varIndex; @@ -1703,17 +1707,6 @@ void CRunningScript::LogAfterProcessingCommand(int32 command) #endif -void FlushLog() -{ -#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT -#if SCRIPT_LOG_FILE_LEVEL == 1 || SCRIPT_LOG_FILE_LEVEL == 2 - if (dbg_log) - fflush(dbg_log); -#endif -#endif -} - - #ifdef MISSION_SWITCHER void CTheScripts::SwitchToMission(int32 mission) @@ -1737,15 +1730,21 @@ CTheScripts::SwitchToMission(int32 mission) #ifdef MISSION_REPLAY missionRetryScriptIndex = mission; - if (missionRetryScriptIndex == 19) - CStats::LastMissionPassedName[0] = '\0'; +#ifdef USE_MISSION_REPLAY_OVERRIDE_FOR_NON_MOBILE_SCRIPT + if (CTheScripts::MissionSupportsMissionReplay(missionRetryScriptIndex)) { + SaveGameForPause(4); + } +#endif #endif CTimer::Suspend(); int offset = CTheScripts::MultiScriptArray[mission]; CFileMgr::ChangeDir("\\"); #ifdef USE_DEBUG_SCRIPT_LOADER - int handle = open_script(); + CFileMgr::ChangeDir("\\data\\"); + int handle = CFileMgr::OpenFile(scriptfile, "rb"); + CFileMgr::ChangeDir("\\"); #else + CFileMgr::ChangeDir("\\"); int handle = CFileMgr::OpenFile("data\\main.scm", "rb"); #endif CFileMgr::Seek(handle, offset, 0); |