summaryrefslogtreecommitdiffstats
path: root/src/control/Script.cpp
diff options
context:
space:
mode:
authorMagnus Larsen <golgothasTerror101@gmail.com>2021-07-10 17:56:28 +0200
committerMagnus Larsen <golgothasTerror101@gmail.com>2021-07-10 18:34:17 +0200
commit33c45e4ae0f10a4b296e520d3691b47bc801ea73 (patch)
tree6591d4f6e541ed89a314eed3168fb785b0778a8a /src/control/Script.cpp
parentreadme: fix lto option (diff)
downloadre3-33c45e4ae0f10a4b296e520d3691b47bc801ea73.tar
re3-33c45e4ae0f10a4b296e520d3691b47bc801ea73.tar.gz
re3-33c45e4ae0f10a4b296e520d3691b47bc801ea73.tar.bz2
re3-33c45e4ae0f10a4b296e520d3691b47bc801ea73.tar.lz
re3-33c45e4ae0f10a4b296e520d3691b47bc801ea73.tar.xz
re3-33c45e4ae0f10a4b296e520d3691b47bc801ea73.tar.zst
re3-33c45e4ae0f10a4b296e520d3691b47bc801ea73.zip
Diffstat (limited to 'src/control/Script.cpp')
-rw-r--r--src/control/Script.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index e06acdc3..09891765 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -1771,20 +1771,12 @@ int scriptToLoad = 0;
int open_script()
{
- // glfwGetKey doesn't work because of CGame::Initialise is blocking
- CPad::UpdatePads();
- if (CPad::GetPad(0)->GetChar('G'))
- scriptToLoad = 0;
- if (CPad::GetPad(0)->GetChar('R'))
- scriptToLoad = 1;
- if (CPad::GetPad(0)->GetChar('D'))
- scriptToLoad = 2;
switch (scriptToLoad) {
- case 0: return CFileMgr::OpenFile("main.scm", "rb");
- case 1: return CFileMgr::OpenFile("main_freeroam.scm", "rb");
- case 2: return CFileMgr::OpenFile("main_d.scm", "rb");
+ case 0: return CFileMgr::OpenFile("data\\main.scm", "rb");
+ case 1: return CFileMgr::OpenFile("data\\main_freeroam.scm", "rb");
+ case 2: return CFileMgr::OpenFile("data\\main_d.scm", "rb");
}
- return CFileMgr::OpenFile("main.scm", "rb");
+ return CFileMgr::OpenFile("data\\main.scm", "rb");
}
#endif
@@ -1800,10 +1792,16 @@ void CTheScripts::Init()
MissionCleanUp.Init();
UpsideDownCars.Init();
StuckCars.Init();
- CFileMgr::SetDir("data");
#ifdef USE_DEBUG_SCRIPT_LOADER
+ // glfwGetKey doesn't work because of CGame::Initialise is blocking
+ CPad::UpdatePads();
+ if(CPad::GetPad(0)->GetChar('G')) scriptToLoad = 0;
+ if(CPad::GetPad(0)->GetChar('R')) scriptToLoad = 1;
+ if(CPad::GetPad(0)->GetChar('D')) scriptToLoad = 2;
+
int mainf = open_script();
#else
+ CFileMgr::SetDir("data");
int mainf = CFileMgr::OpenFile("main.scm", "rb");
#endif
CFileMgr::Read(mainf, (char*)ScriptSpace, SIZE_MAIN_SCRIPT);