summaryrefslogtreecommitdiffstats
path: root/src/control/Script.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-10 14:23:56 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-10 14:23:56 +0200
commit61eb361d264446197af3903e072477b4019f91ce (patch)
treefdfeb6b8415c5cf89c9ab61c8cbe8b5de97fe40e /src/control/Script.cpp
parentMerge pull request #530 from Nick007J/miami (diff)
downloadre3-61eb361d264446197af3903e072477b4019f91ce.tar
re3-61eb361d264446197af3903e072477b4019f91ce.tar.gz
re3-61eb361d264446197af3903e072477b4019f91ce.tar.bz2
re3-61eb361d264446197af3903e072477b4019f91ce.tar.lz
re3-61eb361d264446197af3903e072477b4019f91ce.tar.xz
re3-61eb361d264446197af3903e072477b4019f91ce.tar.zst
re3-61eb361d264446197af3903e072477b4019f91ce.zip
Diffstat (limited to '')
-rw-r--r--src/control/Script.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 90bde151..938a1c25 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -474,11 +474,12 @@ bool CStuckCarCheck::HasCarBeenStuckForAWhile(int32 id)
void CRunningScript::CollectParameters(uint32* pIp, int16 total)
{
for (int16 i = 0; i < total; i++){
- float tmp;
+ //float tmp;
uint16 varIndex;
switch (CTheScripts::Read1ByteFromScript(pIp))
{
case ARGUMENT_INT32:
+ case ARGUMENT_FLOAT:
ScriptParams[i] = CTheScripts::Read4BytesFromScript(pIp);
break;
case ARGUMENT_GLOBALVAR:
@@ -497,9 +498,9 @@ void CRunningScript::CollectParameters(uint32* pIp, int16 total)
case ARGUMENT_INT16:
ScriptParams[i] = CTheScripts::Read2BytesFromScript(pIp);
break;
- case ARGUMENT_FLOAT:
- tmp = CTheScripts::ReadFloatFromScript(pIp);
- ScriptParams[i] = *(int32*)&tmp;
+ //case ARGUMENT_FLOAT:
+ // tmp = CTheScripts::ReadFloatFromScript(pIp);
+ // ScriptParams[i] = *(int32*)&tmp;
break;
default:
assert(0);
@@ -587,6 +588,9 @@ void CRunningScript::Init()
}
#ifdef USE_DEBUG_SCRIPT_LOADER
+
+const char* scriptfile = "main.scm";
+
int open_script()
{
static int scriptToLoad = 1;
@@ -599,11 +603,11 @@ int open_script()
scriptToLoad = 2;
switch (scriptToLoad) {
- case 0: return CFileMgr::OpenFile("main.scm", "rb");
- case 1: return CFileMgr::OpenFile("freeroam_miami.scm", "rb");
- case 2: return CFileMgr::OpenFile("main_d.scm", "rb");
+ case 0: scriptfile = "main.scm"; break;
+ case 1: scriptfile = "freeroam_miami.scm"; break;
+ case 2: scriptfile = "main_d.scm"; break;
}
- return CFileMgr::OpenFile("main.scm", "rb");
+ return CFileMgr::OpenFile(scriptfile, "rb");
}
#endif
@@ -8703,8 +8707,13 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
CollectParameters(&m_nIp, 1);
CTimer::Suspend();
int offset = CTheScripts::MultiScriptArray[ScriptParams[0]];
+#ifdef USE_DEBUG_SCRIPT_LOADER
+ CFileMgr::ChangeDir("\\data\\");
+ int handle = CFileMgr::OpenFile(scriptfile, "rb");
+#else
CFileMgr::ChangeDir("\\");
int handle = CFileMgr::OpenFile("data\\main.scm", "rb");
+#endif
CFileMgr::Seek(handle, offset, 0);
CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
CFileMgr::CloseFile(handle);