diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-23 21:04:24 +0100 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-23 21:04:24 +0100 |
commit | 37d1aa41296f3ea1e912041d4fc201df54ad2639 (patch) | |
tree | 5b01aa010def0f2dcc739559237d627ceb44e3eb /src/control/Script.cpp | |
parent | added some missing functions (diff) | |
download | re3-37d1aa41296f3ea1e912041d4fc201df54ad2639.tar re3-37d1aa41296f3ea1e912041d4fc201df54ad2639.tar.gz re3-37d1aa41296f3ea1e912041d4fc201df54ad2639.tar.bz2 re3-37d1aa41296f3ea1e912041d4fc201df54ad2639.tar.lz re3-37d1aa41296f3ea1e912041d4fc201df54ad2639.tar.xz re3-37d1aa41296f3ea1e912041d4fc201df54ad2639.tar.zst re3-37d1aa41296f3ea1e912041d4fc201df54ad2639.zip |
Diffstat (limited to 'src/control/Script.cpp')
-rw-r--r-- | src/control/Script.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 7712a335..e1e1fbc2 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -426,7 +426,7 @@ const tScriptCommandData commands[] = { REGISTER_COMMAND(COMMAND_ADD_SCORE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_IS_SCORE_GREATER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), true, -1, ""), REGISTER_COMMAND(COMMAND_STORE_SCORE, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(ARGTYPE_INT, ), false, -1, ""), - REGISTER_COMMAND(COMMAND_GIVE_REMOTE_CONTROLLED_CAR_TO_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(), false, -1, ""), + REGISTER_COMMAND(COMMAND_GIVE_REMOTE_CONTROLLED_CAR_TO_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(ARGTYPE_INT, ), false, -1, ""), REGISTER_COMMAND(COMMAND_ALTER_WANTED_LEVEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_ALTER_WANTED_LEVEL_NO_DROP, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_IS_WANTED_LEVEL_GREATER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), true, -1, ""), @@ -2140,9 +2140,7 @@ void CMissionCleanup::Process() default: break; } - m_sEntities[i].id = 0; - m_sEntities[i].type = CLEANUP_UNUSED; - m_nCount--; + RemoveEntityFromList(i, m_sEntities[i].type); } for (int i = 1; i < NUMSTREAMINFO; i++) { if (CStreaming::IsScriptOwnedModel(i)) @@ -2517,7 +2515,7 @@ int32* GetPointerToScriptVariable(CRunningScript* pScript, uint32* pIp) return &pScript->m_anLocalVariables[NUM_LOCAL_VARS + 8 + (type - ARGUMENT_TIMER)]; } script_assert(false && "wrong type for variable"); - return nil; + return &pScript->m_anLocalVariables[pScript->m_nLocalsPointer + (type - ARGUMENT_LOCAL)]; } int32 *CRunningScript::GetPointerToScriptVariable(uint32* pIp, int16 type) @@ -2912,7 +2910,9 @@ int8 CRunningScript::ProcessOneCommand() uint8 nLocalsOffset; if (command < ARRAY_SIZE(commands)) { script_assert(commands[command].id == command); + m_nIp -= 2; sprintf(commandInfo, m_nIp >= CTheScripts::MainScriptSize ? "M<%5d> " : "<%6d> ", m_nIp >= CTheScripts::MainScriptSize ? m_nIp - CTheScripts::MainScriptSize : m_nIp); + m_nIp += 2; if (m_bNotFlag) strcat(commandInfo, "NOT "); if (commands[command].position == -1) @@ -4934,7 +4934,9 @@ int8 CRunningScript::ProcessCommands200To299(int32 command) CVector pos = GET_VECTOR_PARAM(1); if (pos.z <= MAP_Z_LOW_LIMIT) pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y); - CRemote::GivePlayerRemoteControlledCar(pos.x, pos.y, pos.z, DEGTORAD(GET_FLOAT_PARAM(4)), MI_RCBANDIT); + CVehicle* pVehicle = CRemote::GivePlayerRemoteControlledCar(pos.x, pos.y, pos.z, DEGTORAD(GET_FLOAT_PARAM(4)), MI_RCBANDIT); + SET_INTEGER_PARAM(0, CPools::GetVehiclePool()->GetIndex(pVehicle)); + StoreParameters(&m_nIp, 1); return 0; } case COMMAND_ALTER_WANTED_LEVEL: |