diff options
author | withmorten <morten.with@gmail.com> | 2021-01-22 00:20:51 +0100 |
---|---|---|
committer | withmorten <morten.with@gmail.com> | 2021-01-22 00:20:51 +0100 |
commit | d1317f8fa649120f841f8c1f8bcf17b3ee74c235 (patch) | |
tree | 5adc99bd4296a54cc49354b291876603a72eed6e /src/control | |
parent | fuck (diff) | |
download | re3-d1317f8fa649120f841f8c1f8bcf17b3ee74c235.tar re3-d1317f8fa649120f841f8c1f8bcf17b3ee74c235.tar.gz re3-d1317f8fa649120f841f8c1f8bcf17b3ee74c235.tar.bz2 re3-d1317f8fa649120f841f8c1f8bcf17b3ee74c235.tar.lz re3-d1317f8fa649120f841f8c1f8bcf17b3ee74c235.tar.xz re3-d1317f8fa649120f841f8c1f8bcf17b3ee74c235.tar.zst re3-d1317f8fa649120f841f8c1f8bcf17b3ee74c235.zip |
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/CarAI.cpp | 30 | ||||
-rw-r--r-- | src/control/CarCtrl.cpp | 18 | ||||
-rw-r--r-- | src/control/GameLogic.cpp | 2 | ||||
-rw-r--r-- | src/control/Garages.cpp | 2 | ||||
-rw-r--r-- | src/control/Pickups.cpp | 4 | ||||
-rw-r--r-- | src/control/Script.cpp | 2 | ||||
-rw-r--r-- | src/control/Script2.cpp | 2 | ||||
-rw-r--r-- | src/control/Script8.cpp | 2 | ||||
-rw-r--r-- | src/control/SetPieces.cpp | 14 |
9 files changed, 38 insertions, 38 deletions
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp index e7f3a546..54f81519 100644 --- a/src/control/CarAI.cpp +++ b/src/control/CarAI.cpp @@ -44,7 +44,7 @@ float CCarAI::FindSwitchDistanceFar(CVehicle* pVehicle) void CCarAI::BackToCruisingIfNoWantedLevel(CVehicle* pVehicle) { if (FindPlayerPed()->m_pWanted->m_bIgnoredByEveryone || pVehicle->bIsLawEnforcer && - (FindPlayerPed()->m_pWanted->m_nWantedLevel == 0 || FindPlayerPed()->m_pWanted->m_bIgnoredByCops || CCullZones::NoPolice())) { + (FindPlayerPed()->m_pWanted->GetWantedLevel() == 0 || FindPlayerPed()->m_pWanted->m_bIgnoredByCops || CCullZones::NoPolice())) { CCarCtrl::JoinCarWithRoadSystem(pVehicle); pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE; pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS; @@ -118,7 +118,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle) TellOccupantsToLeaveCar(pVehicle); pVehicle->AutoPilot.m_nCruiseSpeed = 0; pVehicle->AutoPilot.m_nCarMission = MISSION_NONE; - if (FindPlayerPed()->m_pWanted->m_nWantedLevel <= 1) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() <= 1) pVehicle->m_bSirenOrAlarm = false; } } @@ -160,7 +160,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle) TellOccupantsToLeaveCar(pVehicle); pVehicle->AutoPilot.m_nCruiseSpeed = 0; pVehicle->AutoPilot.m_nCarMission = MISSION_NONE; - if (FindPlayerPed()->m_pWanted->m_nWantedLevel <= 1) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() <= 1) pVehicle->m_bSirenOrAlarm = false; } } @@ -333,7 +333,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle) pVehicle->AutoPilot.m_nCarMission = MISSION_STOP_FOREVER; } if (distance > 70.0f || FindPlayerPed()->m_pWanted->m_bIgnoredByEveryone || - (FindPlayerPed()->m_pWanted->m_nWantedLevel == 0 || FindPlayerPed()->m_pWanted->m_bIgnoredByCops || CCullZones::NoPolice())) { + (FindPlayerPed()->m_pWanted->GetWantedLevel() == 0 || FindPlayerPed()->m_pWanted->m_bIgnoredByCops || CCullZones::NoPolice())) { TellOccupantsToLeaveCar(pVehicle); pVehicle->AutoPilot.m_nCruiseSpeed = 0; pVehicle->AutoPilot.m_nCarMission = MISSION_STOP_FOREVER; @@ -350,7 +350,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle) break; } default: - if (pVehicle->bIsLawEnforcer && FindPlayerPed()->m_pWanted->m_nWantedLevel > 0 && !CCullZones::NoPolice()){ + if (pVehicle->bIsLawEnforcer && FindPlayerPed()->m_pWanted->GetWantedLevel() > 0 && !CCullZones::NoPolice()){ if (ABS(FindPlayerCoors().x - pVehicle->GetPosition().x) > 10.0f || ABS(FindPlayerCoors().y - pVehicle->GetPosition().y) > 10.0f){ pVehicle->AutoPilot.m_nCruiseSpeed = FindPoliceCarSpeedForWantedLevel(pVehicle); @@ -364,7 +364,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle) TellOccupantsToLeaveCar(pVehicle); pVehicle->AutoPilot.m_nCruiseSpeed = 0; pVehicle->AutoPilot.m_nCarMission = MISSION_NONE; - if (FindPlayerPed()->m_pWanted->m_nWantedLevel <= 1) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() <= 1) pVehicle->m_bSirenOrAlarm = false; } } @@ -377,7 +377,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle) pVehicle->AutoPilot.m_nCruiseSpeed = 0; break; } - if (pVehicle->bIsLawEnforcer && FindPlayerPed()->m_pWanted->m_nWantedLevel >= 1 && CCullZones::PoliceAbandonCars()) { + if (pVehicle->bIsLawEnforcer && FindPlayerPed()->m_pWanted->GetWantedLevel() >= 1 && CCullZones::PoliceAbandonCars()) { TellOccupantsToLeaveCar(pVehicle); pVehicle->AutoPilot.m_nCruiseSpeed = 0; pVehicle->AutoPilot.m_nCarMission = MISSION_NONE; @@ -485,7 +485,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle) else pVehicle->AutoPilot.m_fCruiseSpeedMultiplier += change; - if (pVehicle->bIsLawEnforcer && FindPlayerPed()->m_pWanted->m_nWantedLevel > 0) { + if (pVehicle->bIsLawEnforcer && FindPlayerPed()->m_pWanted->GetWantedLevel() > 0) { if (!FindPlayerVehicle() || FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_APPEARANCE_CAR || FindPlayerVehicle()->GetVehicleAppearance() == VEHICLE_APPEARANCE_BIKE) { @@ -550,7 +550,7 @@ void CCarAI::AddPoliceCarOccupants(CVehicle* pVehicle) case MI_RHINO: case MI_BARRACKS: pVehicle->SetUpDriver(); - if (FindPlayerPed()->m_pWanted->m_nWantedLevel > 1) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() > 1) pVehicle->SetupPassenger(0); return; case MI_PREDATOR: @@ -636,7 +636,7 @@ void CCarAI::TellCarToBlockOtherCar(CVehicle* pVehicle, CVehicle* pTarget) uint8 CCarAI::FindPoliceCarMissionForWantedLevel() { - switch (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->m_nWantedLevel){ + switch (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->GetWantedLevel()){ case 0: case 1: return MISSION_BLOCKPLAYER_FARAWAY; case 2: return (CGeneral::GetRandomNumber() & 3) >= 3 ? MISSION_RAMPLAYER_FARAWAY : MISSION_BLOCKPLAYER_FARAWAY; @@ -650,7 +650,7 @@ uint8 CCarAI::FindPoliceCarMissionForWantedLevel() uint8 CCarAI::FindPoliceBoatMissionForWantedLevel() { - switch (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->m_nWantedLevel) { + switch (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->GetWantedLevel()) { case 0: case 1: return MISSION_BLOCKPLAYER_FARAWAY; case 2: @@ -664,7 +664,7 @@ uint8 CCarAI::FindPoliceBoatMissionForWantedLevel() int32 CCarAI::FindPoliceCarSpeedForWantedLevel(CVehicle* pVehicle) { - switch (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->m_nWantedLevel) { + switch (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->GetWantedLevel()) { case 0: return CGeneral::GetRandomNumberInRange(12, 16); case 1: return 25; case 2: return 34; @@ -678,7 +678,7 @@ int32 CCarAI::FindPoliceCarSpeedForWantedLevel(CVehicle* pVehicle) void CCarAI::MellowOutChaseSpeed(CVehicle* pVehicle) { - if (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->m_nWantedLevel == 1){ + if (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->GetWantedLevel() == 1){ float distanceToPlayer = (pVehicle->GetPosition() - FindPlayerCoors()).Magnitude(); if (FindPlayerVehicle()){ if (distanceToPlayer < 10.0f) @@ -695,7 +695,7 @@ void CCarAI::MellowOutChaseSpeed(CVehicle* pVehicle) else pVehicle->AutoPilot.m_nCruiseSpeed = 25; } - }else if (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->m_nWantedLevel == 2){ + }else if (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->GetWantedLevel() == 2){ float distanceToPlayer = (pVehicle->GetPosition() - FindPlayerCoors()).Magnitude(); if (FindPlayerVehicle()) { if (distanceToPlayer < 10.0f) @@ -722,7 +722,7 @@ void CCarAI::MellowOutChaseSpeed(CVehicle* pVehicle) void CCarAI::MellowOutChaseSpeedBoat(CVehicle* pVehicle) { - switch (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->m_nWantedLevel) { + switch (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->GetWantedLevel()) { case 0: pVehicle->AutoPilot.m_nCruiseSpeed = 8; break; case 1: pVehicle->AutoPilot.m_nCruiseSpeed = 10; break; case 2: pVehicle->AutoPilot.m_nCruiseSpeed = 15; break; diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 3299ce00..5aefcf76 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -152,18 +152,18 @@ CCarCtrl::GenerateOneRandomCar() CWanted* pWanted = pPlayer->m_pPed->m_pWanted; int carClass; int carModel; - if (pWanted->m_nWantedLevel > 1 && NumLawEnforcerCars < pWanted->m_MaximumLawEnforcerVehicles && + if (pWanted->GetWantedLevel() > 1 && NumLawEnforcerCars < pWanted->m_MaximumLawEnforcerVehicles && pWanted->m_CurrentCops < pWanted->m_MaxCops && !CGame::IsInInterior() && ( - pWanted->m_nWantedLevel > 3 || - pWanted->m_nWantedLevel > 2 && CTimer::GetTimeInMilliseconds() > LastTimeLawEnforcerCreated + 5000 || - pWanted->m_nWantedLevel > 1 && CTimer::GetTimeInMilliseconds() > LastTimeLawEnforcerCreated + 8000)) { - /* Last pWanted->m_nWantedLevel > 1 is unnecessary but I added it for better readability. */ + pWanted->GetWantedLevel() > 3 || + pWanted->GetWantedLevel() > 2 && CTimer::GetTimeInMilliseconds() > LastTimeLawEnforcerCreated + 5000 || + pWanted->GetWantedLevel() > 1 && CTimer::GetTimeInMilliseconds() > LastTimeLawEnforcerCreated + 8000)) { + /* Last pWanted->GetWantedLevel() > 1 is unnecessary but I added it for better readability. */ /* Wouldn't be surprised it was there originally but was optimized out. */ carClass = COPS; carModel = ChoosePoliceCarModel(); }else{ carModel = ChooseModel(&zone, &carClass); - if (carModel == -1 || (carClass == COPS && pWanted->m_nWantedLevel >= 1)) + if (carModel == -1 || (carClass == COPS && pWanted->GetWantedLevel() >= 1)) /* All cop spawns with wanted level are handled by condition above. */ /* In particular it means that cop cars never spawn if player has wanted level of 1. */ return; @@ -296,7 +296,7 @@ CCarCtrl::GenerateOneRandomCar() } if (!ThePaths.GenerateCarCreationCoors(vecTargetPos.x, vecTargetPos.y, frontX, frontY, preferredDistance, angleLimit, invertAngleLimitTest, &spawnPosition, &curNodeId, &nextNodeId, - &positionBetweenNodes, carClass == COPS && pWanted->m_nWantedLevel >= 1)) + &positionBetweenNodes, carClass == COPS && pWanted->GetWantedLevel() >= 1)) return; CPathNode* pCurNode = &ThePaths.m_pathNodes[curNodeId]; CPathNode* pNextNode = &ThePaths.m_pathNodes[nextNodeId]; @@ -360,7 +360,7 @@ CCarCtrl::GenerateOneRandomCar() switch (carClass) { case COPS: pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE; - if (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->m_nWantedLevel != 0){ + if (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted->GetWantedLevel() != 0){ pVehicle->AutoPilot.m_nCruiseSpeed = CCarAI::FindPoliceCarSpeedForWantedLevel(pVehicle); pVehicle->AutoPilot.m_fMaxTrafficSpeed = pVehicle->AutoPilot.m_nCruiseSpeed / 2; pVehicle->AutoPilot.m_nCarMission = CCarAI::FindPoliceCarMissionForWantedLevel(); @@ -3166,7 +3166,7 @@ void CCarCtrl::FindLinksToGoWithTheseNodes(CVehicle* pVehicle) void CCarCtrl::GenerateEmergencyServicesCar(void) { - if (FindPlayerPed()->m_pWanted->m_nWantedLevel > 3) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() > 3) return; if (CGame::IsInInterior()) return; diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp index e7f7d525..d971b67f 100644 --- a/src/control/GameLogic.cpp +++ b/src/control/GameLogic.cpp @@ -222,7 +222,7 @@ CGameLogic::Update() pPlayerInfo.m_WBState = WBSTATE_PLAYING; int takeMoney; - switch (pPlayerInfo.m_pPed->m_pWanted->m_nWantedLevel) { + switch (pPlayerInfo.m_pPed->m_pWanted->GetWantedLevel()) { case 0: case 1: takeMoney = 100; diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index 1fecdf22..0794a31c 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -452,7 +452,7 @@ void CGarage::Update() m_eGarageState = GS_OPENING; DMAudio.PlayFrontEndSound(SOUND_GARAGE_OPENING, 1); bool bTakeMoney = false; - if (FindPlayerPed()->m_pWanted->m_nWantedLevel != 0) { + if (FindPlayerPed()->m_pWanted->GetWantedLevel() != 0) { bTakeMoney = true; FindPlayerPed()->m_pWanted->Suspend(); } diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp index 5186a8d2..8c9d1031 100644 --- a/src/control/Pickups.cpp +++ b/src/control/Pickups.cpp @@ -278,7 +278,7 @@ CPickup::CanBePickedUp(CPlayerPed *player, int playerId) bool cannotBePickedUp = (m_pObject->GetModelIndex() == MI_PICKUP_BODYARMOUR && player->m_fArmour > CWorld::Players[playerId].m_nMaxArmour - 0.5f) || (m_pObject->GetModelIndex() == MI_PICKUP_HEALTH && player->m_fHealth > CWorld::Players[playerId].m_nMaxHealth - 0.5f) - || (m_pObject->GetModelIndex() == MI_PICKUP_BRIBE && player->m_pWanted->m_nWantedLevel == 0) + || (m_pObject->GetModelIndex() == MI_PICKUP_BRIBE && player->m_pWanted->GetWantedLevel() == 0) || (m_pObject->GetModelIndex() == MI_PICKUP_KILLFRENZY && (CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame)); return !cannotBePickedUp; } @@ -784,7 +784,7 @@ CPickups::GivePlayerGoodiesWithPickUpMI(int16 modelIndex, int playerIndex) DMAudio.PlayFrontEndSound(SOUND_PICKUP_BONUS, 0); return true; } else if (modelIndex == MI_PICKUP_BRIBE) { - int32 level = Max(FindPlayerPed()->m_pWanted->m_nWantedLevel - 1, 0); + int32 level = Max(FindPlayerPed()->m_pWanted->GetWantedLevel() - 1, 0); player->SetWantedLevel(level); DMAudio.PlayFrontEndSound(SOUND_PICKUP_BONUS, 0); return true; diff --git a/src/control/Script.cpp b/src/control/Script.cpp index a61c6b09..bd056805 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -4545,7 +4545,7 @@ int8 CRunningScript::ProcessCommands200To299(int32 command) return 0; case COMMAND_IS_WANTED_LEVEL_GREATER: CollectParameters(&m_nIp, 2); - UpdateCompareFlag(CWorld::Players[ScriptParams[0]].m_pPed->m_pWanted->m_nWantedLevel > ScriptParams[1]); + UpdateCompareFlag(CWorld::Players[ScriptParams[0]].m_pPed->m_pWanted->GetWantedLevel() > ScriptParams[1]); return 0; case COMMAND_CLEAR_WANTED_LEVEL: CollectParameters(&m_nIp, 1); diff --git a/src/control/Script2.cpp b/src/control/Script2.cpp index f2d9ed9e..656973ca 100644 --- a/src/control/Script2.cpp +++ b/src/control/Script2.cpp @@ -1030,7 +1030,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) CollectParameters(&m_nIp, 1); CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed; script_assert(pPed); - ScriptParams[0] = pPed->m_pWanted->m_nWantedLevel; + ScriptParams[0] = pPed->m_pWanted->GetWantedLevel(); StoreParameters(&m_nIp, 1); return 0; } diff --git a/src/control/Script8.cpp b/src/control/Script8.cpp index c34830e7..9a8e536e 100644 --- a/src/control/Script8.cpp +++ b/src/control/Script8.cpp @@ -67,7 +67,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) case COMMAND_WANTED_STARS_ARE_FLASHING: { CWanted* pWanted = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted; - UpdateCompareFlag(pWanted->m_nMinWantedLevel - pWanted->m_nWantedLevel > 0); + UpdateCompareFlag(pWanted->m_nMinWantedLevel - pWanted->GetWantedLevel() > 0); return 0; } case COMMAND_SET_ALLOW_HURRICANES: diff --git a/src/control/SetPieces.cpp b/src/control/SetPieces.cpp index bbcfa1ea..e2fa2ef6 100644 --- a/src/control/SetPieces.cpp +++ b/src/control/SetPieces.cpp @@ -86,7 +86,7 @@ void CSetPiece::Update(void) switch (m_nType) { case SETPIECE_TWOCOPCARSINALLEY: { - if (FindPlayerPed()->m_pWanted->m_nWantedLevel < 1 || FindPlayerVehicle()) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() < 1 || FindPlayerVehicle()) return; CVehicle* pVehicle1 = TryToGenerateCopCar(m_vSpawn1, m_vTarget1); if (!pVehicle1) @@ -120,7 +120,7 @@ void CSetPiece::Update(void) } case SETPIECE_CARBLOCKINGPLAYERFROMSIDE: { - if (FindPlayerPed()->m_pWanted->m_nWantedLevel < 2) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() < 2) return; if (!FindPlayerVehicle()) return; @@ -143,7 +143,7 @@ void CSetPiece::Update(void) } case SETPIECE_CARRAMMINGPLAYERFROMSIDE: { - if (FindPlayerPed()->m_pWanted->m_nWantedLevel < 2) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() < 2) return; if (!FindPlayerVehicle()) return; @@ -166,7 +166,7 @@ void CSetPiece::Update(void) } case SETPIECE_CREATECOPPERONFOOT: { - if (FindPlayerPed()->m_pWanted->m_nWantedLevel < 1 || FindPlayerVehicle()) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() < 1 || FindPlayerVehicle()) return; CCopPed* pCop = TryToGenerateCopPed(m_vSpawn1); if (!pCop) @@ -180,7 +180,7 @@ void CSetPiece::Update(void) } case SETPIECE_CREATETWOCOPPERSONFOOT: { - if (FindPlayerPed()->m_pWanted->m_nWantedLevel < 1 || FindPlayerVehicle()) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() < 1 || FindPlayerVehicle()) return; CCopPed* pCop = TryToGenerateCopPed(m_vSpawn1); if (!pCop) @@ -204,7 +204,7 @@ void CSetPiece::Update(void) } case SETPIECE_TWOCARSBLOCKINGPLAYERFROMSIDE: { - if (FindPlayerPed()->m_pWanted->m_nWantedLevel < 2) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() < 2) return; if (!FindPlayerVehicle()) return; @@ -242,7 +242,7 @@ void CSetPiece::Update(void) } case SETPIECE_TWOCARSRAMMINGPLAYERFROMSIDE: { - if (FindPlayerPed()->m_pWanted->m_nWantedLevel < 2) + if (FindPlayerPed()->m_pWanted->GetWantedLevel() < 2) return; if (!FindPlayerVehicle()) return; |