summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-08-03 21:14:58 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2021-08-07 19:40:18 +0200
commita7e86e0510e02ad9992624199a41cd2f82a8ca52 (patch)
tree8b9a41580ec19751359769fec21bf59d15e4ac0f
parentmove debug (diff)
downloadre3-a7e86e0510e02ad9992624199a41cd2f82a8ca52.tar
re3-a7e86e0510e02ad9992624199a41cd2f82a8ca52.tar.gz
re3-a7e86e0510e02ad9992624199a41cd2f82a8ca52.tar.bz2
re3-a7e86e0510e02ad9992624199a41cd2f82a8ca52.tar.lz
re3-a7e86e0510e02ad9992624199a41cd2f82a8ca52.tar.xz
re3-a7e86e0510e02ad9992624199a41cd2f82a8ca52.tar.zst
re3-a7e86e0510e02ad9992624199a41cd2f82a8ca52.zip
-rw-r--r--src/control/Script.h5
-rw-r--r--src/control/ScriptDebug.cpp27
2 files changed, 18 insertions, 14 deletions
diff --git a/src/control/Script.h b/src/control/Script.h
index 22642537..98db6c89 100644
--- a/src/control/Script.h
+++ b/src/control/Script.h
@@ -49,6 +49,11 @@ void FlushLog();
#define KEY_LENGTH_IN_SCRIPT (8)
+#ifdef USE_DEBUG_SCRIPT_LOADER
+extern const char* scriptfile;
+#endif
+
+//#define GTA_SCRIPT_COLLECTIVE
#define GET_INTEGER_PARAM(i) (ScriptParams[i])
#define GET_FLOAT_PARAM(i) (*(float*)&ScriptParams[i])
#define GET_VECTOR_PARAM(i) (CVector(GET_FLOAT_PARAM(i), GET_FLOAT_PARAM(i+1), GET_FLOAT_PARAM(i+2)))
diff --git a/src/control/ScriptDebug.cpp b/src/control/ScriptDebug.cpp
index 2a9cbac2..325575d9 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"
@@ -1905,6 +1908,7 @@ void CRunningScript::LogBeforeProcessingCommand(int32 command)
uint32 t = m_nIp;
m_nIp = storedIp;
storedIp = t;
+ }
}
void CRunningScript::LogAfterProcessingCommand(int32 command)
@@ -1944,17 +1948,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)
@@ -1978,15 +1971,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);