diff options
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/GameLogic.cpp | 2 | ||||
-rw-r--r-- | src/control/Script.h | 3 | ||||
-rw-r--r-- | src/control/Script2.cpp | 4 | ||||
-rw-r--r-- | src/control/Script6.cpp | 26 | ||||
-rw-r--r-- | src/control/Script7.cpp | 4 | ||||
-rw-r--r-- | src/control/Script8.cpp | 6 |
6 files changed, 22 insertions, 23 deletions
diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp index 2eea9645..93e6c67d 100644 --- a/src/control/GameLogic.cpp +++ b/src/control/GameLogic.cpp @@ -393,7 +393,7 @@ CGameLogic::RestorePlayerStuffDuringResurrection(CPlayerPed *pPlayerPed, CVector CWorld::Add(pPlayerPed); CHud::ResetWastedText(); CStreaming::StreamZoneModels(pos); - clearWaterDrop = true; + //clearWaterDrop = true; } void diff --git a/src/control/Script.h b/src/control/Script.h index aca148d2..233e00e5 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -605,10 +605,9 @@ public: float LimitAngleOnCircle(float angle) { return angle < 0.0f ? angle + 360.0f : angle; } + bool ThisIsAValidRandomCop(uint32 mi, int cop, int swat, int fbi, int army, int miami); bool ThisIsAValidRandomPed(uint32 pedtype, int civ, int gang, int criminal); bool CheckDamagedWeaponType(int32 actual, int32 type); - static bool ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami); - void ReturnFromGosubOrFunction(); }; diff --git a/src/control/Script2.cpp b/src/control/Script2.cpp index 5cac2bfd..9ef24751 100644 --- a/src/control/Script2.cpp +++ b/src/control/Script2.cpp @@ -1349,9 +1349,9 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) CollectParameters(&m_nIp, 2); CPed* pPed = CPools::GetPedPool()->GetAt(GET_INTEGER_PARAM(0)); script_assert(pPed); - CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(GET_INTEGER_PARAM(1)); + CObject* pObject = CPools::GetObjectPool()->GetAt(GET_INTEGER_PARAM(1)); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_DESTROY_OBJECT, pVehicle); + pPed->SetObjective(OBJECTIVE_DESTROY_OBJECT, pObject); return 0; } case COMMAND_SET_CHAR_OBJ_DESTROY_CAR: diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp index 02427eed..3a03ea9b 100644 --- a/src/control/Script6.cpp +++ b/src/control/Script6.cpp @@ -42,6 +42,19 @@ extern const char* scriptfile; #endif +bool CRunningScript::ThisIsAValidRandomCop(uint32 mi, int cop, int swat, int fbi, int army, int miami) +{ + switch (mi) + { + case MI_COP: if (cop) return true; break; + case MI_SWAT: if (swat) return true; break; + case MI_FBI: if (fbi) return true; break; + case MI_ARMY: if (army) return true; break; + default: if (mi >= MI_VICE1 && mi <= MI_VICE8 && miami) return true; break; + } + return false; +} + bool CRunningScript::ThisIsAValidRandomPed(uint32 pedtype, int civ, int gang, int criminal) { switch (pedtype) { @@ -66,19 +79,6 @@ bool CRunningScript::ThisIsAValidRandomPed(uint32 pedtype, int civ, int gang, in } } -bool CRunningScript::ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami) -{ - switch (mi) - { - case MI_COP: if (cop) return true; - case MI_SWAT: if (swat) return true; - case MI_FBI: if (fbi) return true; - case MI_ARMY: if (army) return true; - default: - return miami && (mi >= MI_VICE1 && mi <= MI_VICE8); - } -} - int8 CRunningScript::ProcessCommands1000To1099(int32 command) { switch (command) { diff --git a/src/control/Script7.cpp b/src/control/Script7.cpp index b3f16106..a5c8e717 100644 --- a/src/control/Script7.cpp +++ b/src/control/Script7.cpp @@ -95,8 +95,8 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) CollectParameters(&m_nIp, 2); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); script_assert(pPed); - ScriptParams[0] = pPed->GetWeapon(ScriptParams[1]).m_eWeaponType; - ScriptParams[1] = pPed->GetWeapon(ScriptParams[1]).m_nAmmoTotal; + ScriptParams[0] = pPed->GetWeapon(ScriptParams[1] - 1).m_eWeaponType; + ScriptParams[1] = pPed->GetWeapon(ScriptParams[1] - 1).m_nAmmoTotal; ScriptParams[2] = CPickups::ModelForWeapon((eWeaponType)ScriptParams[0]); StoreParameters(&m_nIp, 3); return 0; diff --git a/src/control/Script8.cpp b/src/control/Script8.cpp index 2f52b150..afa213f2 100644 --- a/src/control/Script8.cpp +++ b/src/control/Script8.cpp @@ -66,7 +66,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) return 0; case COMMAND_WANTED_STARS_ARE_FLASHING: { - CWanted *pWanted = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted; + CWanted* pWanted = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted; UpdateCompareFlag(pWanted->m_nMinWantedLevel - pWanted->m_nWantedLevel > 0); return 0; } @@ -136,7 +136,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) CTheScripts::ReadTextLabelFromScript(&m_nIp, key); m_nIp += KEY_LENGTH_IN_SCRIPT; CVector pos = pPlayerInfo->GetPos(); - CZone *infoZone = CTheZones::FindInformationZoneForPosition(&pos); + CZone* infoZone = CTheZones::FindInformationZoneForPosition(&pos); UpdateCompareFlag(strncmp(key, infoZone->name, 8) == 0); // original code doesn't seem to be using strncmp in here and compare 2 ints instead return 0; } @@ -352,7 +352,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) case COMMAND_CREATE_DUST_EFFECT_FOR_CUTSCENE_HELI: { CollectParameters(&m_nIp, 3); - CObject *pHeli = CPools::GetObjectPool()->GetAt(ScriptParams[0]); + CObject* pHeli = CPools::GetObjectPool()->GetAt(ScriptParams[0]); bool found = false; float waterLevel = -1000.0f; CVector pos = pHeli->GetPosition(); |