diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-09 20:24:52 +0100 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-09 20:24:52 +0100 |
commit | 1b3047c8126a1840033ca28f2fc24d1dbdfe9bc5 (patch) | |
tree | 023ea2aa841ac8489f247d1bd3132a02aa48bffd /src/control | |
parent | fix rendering; update librw (diff) | |
parent | can finish first mission (diff) | |
download | re3-1b3047c8126a1840033ca28f2fc24d1dbdfe9bc5.tar re3-1b3047c8126a1840033ca28f2fc24d1dbdfe9bc5.tar.gz re3-1b3047c8126a1840033ca28f2fc24d1dbdfe9bc5.tar.bz2 re3-1b3047c8126a1840033ca28f2fc24d1dbdfe9bc5.tar.lz re3-1b3047c8126a1840033ca28f2fc24d1dbdfe9bc5.tar.xz re3-1b3047c8126a1840033ca28f2fc24d1dbdfe9bc5.tar.zst re3-1b3047c8126a1840033ca28f2fc24d1dbdfe9bc5.zip |
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/Script.cpp | 11 | ||||
-rw-r--r-- | src/control/Script3.cpp | 4 | ||||
-rw-r--r-- | src/control/Script8.cpp | 23 |
3 files changed, 27 insertions, 11 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp index df851daa..543221c6 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -2179,7 +2179,7 @@ bool CUpsideDownCarCheck::IsCarUpsideDown(int32 id) // done(LCS) bool CUpsideDownCarCheck::IsCarUpsideDown(CVehicle* pVehicle) { - assert(pVehicle); + script_assert(pVehicle); return pVehicle->GetUp().z <= UPSIDEDOWN_UP_THRESHOLD && pVehicle->GetMoveSpeed().Magnitude() < UPSIDEDOWN_MOVE_SPEED_THRESHOLD && pVehicle->GetTurnSpeed().Magnitude() < UPSIDEDOWN_TURN_SPEED_THRESHOLD; @@ -2411,7 +2411,7 @@ int32* GetPointerToScriptVariableForDebug(CRunningScript* pScript, uint32* pIp, return &pScript->m_anLocalVariables[pScript->m_nLocalsPointer + (type - ARGUMENT_LOCAL)]; } else { - assert(type >= ARGUMENT_TIMER); + script_assert(type >= ARGUMENT_TIMER); sprintf(tmpstr, " TIMER%d@", (type - ARGUMENT_TIMER)); strcat(buf, tmpstr); return &pScript->m_anLocalVariables[NUM_LOCAL_VARS + 8 + (type - ARGUMENT_TIMER)]; // why 8? @@ -2534,7 +2534,7 @@ int32* GetPointerToScriptVariable(CRunningScript* pScript, uint32* pIp) return &pScript->m_anLocalVariables[pScript->m_nLocalsPointer + (type - ARGUMENT_LOCAL)]; } else { - assert(type >= ARGUMENT_TIMER); + script_assert(type >= ARGUMENT_TIMER); return &pScript->m_anLocalVariables[NUM_LOCAL_VARS + 8 + (type - ARGUMENT_TIMER)]; } } @@ -4998,7 +4998,10 @@ int8 CRunningScript::ProcessCommands200To299(int32 command) return 0; } //case COMMAND_ADD_AMMO_TO_CAR: - //case COMMAND_IS_PLAYER_STILL_ALIVE: + case COMMAND_IS_PLAYER_STILL_ALIVE: + CollectParameters(&m_nIp, 1); + UpdateCompareFlag(CWorld::Players[ScriptParams[0]].m_WBState != WBSTATE_WASTED); + return 0; case COMMAND_IS_PLAYER_DEAD: CollectParameters(&m_nIp, 1); UpdateCompareFlag(CWorld::Players[ScriptParams[0]].m_WBState == WBSTATE_WASTED); diff --git a/src/control/Script3.cpp b/src/control/Script3.cpp index 0134df00..c2c7d044 100644 --- a/src/control/Script3.cpp +++ b/src/control/Script3.cpp @@ -836,7 +836,6 @@ int8 CRunningScript::ProcessCommands500To599(int32 command) case COMMAND_RESTORE_CLOCK: CClock::RestoreClock(); return 0; - /* case COMMAND_RESTART_CRITICAL_MISSION: { CollectParameters(&m_nIp, 4); @@ -849,7 +848,6 @@ int8 CRunningScript::ProcessCommands500To599(int32 command) CWorld::Players[CWorld::PlayerInFocus].PlayerFailedCriticalMission(); return 0; } - */ case COMMAND_IS_PLAYER_PLAYING: { CollectParameters(&m_nIp, 1); @@ -1357,12 +1355,14 @@ int8 CRunningScript::ProcessCommands600To699(int32 command) UpdateCompareFlag(CTheScripts::IsPedStopped(pPed)); return 0; } + */ case COMMAND_MESSAGE_WAIT: CollectParameters(&m_nIp, 2); m_nWakeTime = CTimer::GetTimeInMilliseconds() + ScriptParams[0]; if (ScriptParams[1] != 0) m_bSkipWakeTime = true; return 1; + /* case COMMAND_ADD_PARTICLE_EFFECT: { CollectParameters(&m_nIp, 5); diff --git a/src/control/Script8.cpp b/src/control/Script8.cpp index f41ef8a4..cf5f1327 100644 --- a/src/control/Script8.cpp +++ b/src/control/Script8.cpp @@ -714,7 +714,7 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command) script_assert(false); return 0; case COMMAND_1539: - script_assert(false); + //TODO (REGISTER_OUTFIT_CHANGE) return 0; case COMMAND_1540: script_assert(false); @@ -741,7 +741,9 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command) script_assert(false); return 0; case COMMAND_1548: - script_assert(false); + // TODO (GET_ONFOOT_CAMERA_MODE) + ScriptParams[0] = 0; + StoreParameters(&m_nIp, 1); return 0; case COMMAND_1549: CollectParameters(&m_nIp, 1); @@ -847,8 +849,11 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command) script_assert(false); return 0; case COMMAND_1581: - script_assert(false); + { + // TODO (SET_HELP_MESSAGE?) + wchar* key = CTheScripts::GetTextByKeyFromScript(&m_nIp); return 0; + } case COMMAND_1582: script_assert(false); return 0; @@ -1062,8 +1067,15 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command) script_assert(false); return 0; case COMMAND_1645: - script_assert(false); + { + CollectParameters(&m_nIp, 1); + // TODO (GET_STORED_WEAPON?) + CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed; + script_assert(pPed); + ScriptParams[0] = pPed->m_storedWeapon; + StoreParameters(&m_nIp, 1); return 0; + } case COMMAND_1646: CollectParameters(&m_nIp, 1); // TODO (DISABLE_PAUSE_MENU?) @@ -1100,7 +1112,8 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command) script_assert(false); return 0; case COMMAND_1656: - script_assert(false); + CollectParameters(&m_nIp, 2); + // TODO (?) return 0; default: script_assert(0); |