Fix debug script loader crashing missions
* open_script is now exposed in Script.h, perhaps it should be namespaced as a static method on CTheScripts? I'm unsure what is preferred. * I've moved the joypad code out of open_script to prevent buttons held down at mission load time from changing the scriptToLoad.
This commit is contained in:
@@ -305,7 +305,11 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
|
||||
CTimer::Suspend();
|
||||
int offset = CTheScripts::MultiScriptArray[ScriptParams[0]];
|
||||
CFileMgr::ChangeDir("\\");
|
||||
#ifdef USE_DEBUG_SCRIPT_LOADER
|
||||
int handle = open_script();
|
||||
#else
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user