mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-12-26 01:31:49 +01:00
script changes
This commit is contained in:
parent
058690aad7
commit
61eb361d26
@ -474,11 +474,12 @@ bool CStuckCarCheck::HasCarBeenStuckForAWhile(int32 id)
|
|||||||
void CRunningScript::CollectParameters(uint32* pIp, int16 total)
|
void CRunningScript::CollectParameters(uint32* pIp, int16 total)
|
||||||
{
|
{
|
||||||
for (int16 i = 0; i < total; i++){
|
for (int16 i = 0; i < total; i++){
|
||||||
float tmp;
|
//float tmp;
|
||||||
uint16 varIndex;
|
uint16 varIndex;
|
||||||
switch (CTheScripts::Read1ByteFromScript(pIp))
|
switch (CTheScripts::Read1ByteFromScript(pIp))
|
||||||
{
|
{
|
||||||
case ARGUMENT_INT32:
|
case ARGUMENT_INT32:
|
||||||
|
case ARGUMENT_FLOAT:
|
||||||
ScriptParams[i] = CTheScripts::Read4BytesFromScript(pIp);
|
ScriptParams[i] = CTheScripts::Read4BytesFromScript(pIp);
|
||||||
break;
|
break;
|
||||||
case ARGUMENT_GLOBALVAR:
|
case ARGUMENT_GLOBALVAR:
|
||||||
@ -497,9 +498,9 @@ void CRunningScript::CollectParameters(uint32* pIp, int16 total)
|
|||||||
case ARGUMENT_INT16:
|
case ARGUMENT_INT16:
|
||||||
ScriptParams[i] = CTheScripts::Read2BytesFromScript(pIp);
|
ScriptParams[i] = CTheScripts::Read2BytesFromScript(pIp);
|
||||||
break;
|
break;
|
||||||
case ARGUMENT_FLOAT:
|
//case ARGUMENT_FLOAT:
|
||||||
tmp = CTheScripts::ReadFloatFromScript(pIp);
|
// tmp = CTheScripts::ReadFloatFromScript(pIp);
|
||||||
ScriptParams[i] = *(int32*)&tmp;
|
// ScriptParams[i] = *(int32*)&tmp;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
@ -587,6 +588,9 @@ void CRunningScript::Init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_DEBUG_SCRIPT_LOADER
|
#ifdef USE_DEBUG_SCRIPT_LOADER
|
||||||
|
|
||||||
|
const char* scriptfile = "main.scm";
|
||||||
|
|
||||||
int open_script()
|
int open_script()
|
||||||
{
|
{
|
||||||
static int scriptToLoad = 1;
|
static int scriptToLoad = 1;
|
||||||
@ -599,11 +603,11 @@ int open_script()
|
|||||||
scriptToLoad = 2;
|
scriptToLoad = 2;
|
||||||
|
|
||||||
switch (scriptToLoad) {
|
switch (scriptToLoad) {
|
||||||
case 0: return CFileMgr::OpenFile("main.scm", "rb");
|
case 0: scriptfile = "main.scm"; break;
|
||||||
case 1: return CFileMgr::OpenFile("freeroam_miami.scm", "rb");
|
case 1: scriptfile = "freeroam_miami.scm"; break;
|
||||||
case 2: return CFileMgr::OpenFile("main_d.scm", "rb");
|
case 2: scriptfile = "main_d.scm"; break;
|
||||||
}
|
}
|
||||||
return CFileMgr::OpenFile("main.scm", "rb");
|
return CFileMgr::OpenFile(scriptfile, "rb");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -8703,8 +8707,13 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
|
|||||||
CollectParameters(&m_nIp, 1);
|
CollectParameters(&m_nIp, 1);
|
||||||
CTimer::Suspend();
|
CTimer::Suspend();
|
||||||
int offset = CTheScripts::MultiScriptArray[ScriptParams[0]];
|
int offset = CTheScripts::MultiScriptArray[ScriptParams[0]];
|
||||||
|
#ifdef USE_DEBUG_SCRIPT_LOADER
|
||||||
|
CFileMgr::ChangeDir("\\data\\");
|
||||||
|
int handle = CFileMgr::OpenFile(scriptfile, "rb");
|
||||||
|
#else
|
||||||
CFileMgr::ChangeDir("\\");
|
CFileMgr::ChangeDir("\\");
|
||||||
int handle = CFileMgr::OpenFile("data\\main.scm", "rb");
|
int handle = CFileMgr::OpenFile("data\\main.scm", "rb");
|
||||||
|
#endif
|
||||||
CFileMgr::Seek(handle, offset, 0);
|
CFileMgr::Seek(handle, offset, 0);
|
||||||
CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
|
CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
|
||||||
CFileMgr::CloseFile(handle);
|
CFileMgr::CloseFile(handle);
|
||||||
|
Loading…
Reference in New Issue
Block a user