diff options
author | aap <aap@papnet.eu> | 2021-01-22 10:33:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-22 10:33:55 +0100 |
commit | 4acc9b08a2179ebf2a12e52759f7b4193c047533 (patch) | |
tree | 5adc99bd4296a54cc49354b291876603a72eed6e /src/control/CarCtrl.cpp | |
parent | fuck (diff) | |
parent | m_nWantedLevel -> GetWantedLevel() (diff) | |
download | re3-4acc9b08a2179ebf2a12e52759f7b4193c047533.tar re3-4acc9b08a2179ebf2a12e52759f7b4193c047533.tar.gz re3-4acc9b08a2179ebf2a12e52759f7b4193c047533.tar.bz2 re3-4acc9b08a2179ebf2a12e52759f7b4193c047533.tar.lz re3-4acc9b08a2179ebf2a12e52759f7b4193c047533.tar.xz re3-4acc9b08a2179ebf2a12e52759f7b4193c047533.tar.zst re3-4acc9b08a2179ebf2a12e52759f7b4193c047533.zip |
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r-- | src/control/CarCtrl.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
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; |