summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-01-22 10:34:01 +0100
committerGitHub <noreply@github.com>2021-01-22 10:34:01 +0100
commitd77846bb16911db3d2ebffd6ec6425fcaf3463d1 (patch)
treee0c2952a6d863b7cde0f46aca121c37ed39f8696 /src
parentfree cam fixes (diff)
parentm_nWantedLevel -> GetWantedLevel() (diff)
downloadre3-d77846bb16911db3d2ebffd6ec6425fcaf3463d1.tar
re3-d77846bb16911db3d2ebffd6ec6425fcaf3463d1.tar.gz
re3-d77846bb16911db3d2ebffd6ec6425fcaf3463d1.tar.bz2
re3-d77846bb16911db3d2ebffd6ec6425fcaf3463d1.tar.lz
re3-d77846bb16911db3d2ebffd6ec6425fcaf3463d1.tar.xz
re3-d77846bb16911db3d2ebffd6ec6425fcaf3463d1.tar.zst
re3-d77846bb16911db3d2ebffd6ec6425fcaf3463d1.zip
Diffstat (limited to 'src')
-rw-r--r--src/audio/PoliceRadio.cpp4
-rw-r--r--src/control/CarAI.cpp28
-rw-r--r--src/control/CarCtrl.cpp18
-rw-r--r--src/control/GameLogic.cpp2
-rw-r--r--src/control/Garages.cpp2
-rw-r--r--src/control/Pickups.cpp4
-rw-r--r--src/control/Script.cpp2
-rw-r--r--src/control/Script2.cpp2
-rw-r--r--src/core/Camera.cpp4
-rw-r--r--src/core/Pad.cpp2
-rw-r--r--src/core/Wanted.h1
-rw-r--r--src/peds/CopPed.cpp6
-rw-r--r--src/peds/PedAI.cpp2
-rw-r--r--src/peds/Population.cpp2
-rw-r--r--src/render/Hud.cpp2
-rw-r--r--src/vehicles/Automobile.cpp2
-rw-r--r--src/vehicles/Heli.cpp2
17 files changed, 43 insertions, 42 deletions
diff --git a/src/audio/PoliceRadio.cpp b/src/audio/PoliceRadio.cpp
index 7021b5be..785dbf8f 100644
--- a/src/audio/PoliceRadio.cpp
+++ b/src/audio/PoliceRadio.cpp
@@ -161,7 +161,7 @@ cAudioManager::ServicePoliceRadio()
if(CReplay::IsPlayingBack() || !FindPlayerPed() || !FindPlayerPed()->m_pWanted)
return;
#endif
- wantedLevel = FindPlayerPed()->m_pWanted->m_nWantedLevel;
+ wantedLevel = FindPlayerPed()->m_pWanted->GetWantedLevel();
if(!crimeReport) {
if(wantedLevel != 0) {
if(nLastSeen != 0) {
@@ -679,7 +679,7 @@ void
cAudioManager::ReportCrime(eCrimeType type, const CVector &pos)
{
int32 lastCrime = ARRAY_SIZE(m_sPoliceRadioQueue.crimes);
- if (m_bIsInitialised && MusicManager.m_nMusicMode != MUSICMODE_CUTSCENE && FindPlayerPed()->m_pWanted->m_nWantedLevel > 0 &&
+ if (m_bIsInitialised && MusicManager.m_nMusicMode != MUSICMODE_CUTSCENE && FindPlayerPed()->m_pWanted->GetWantedLevel() > 0 &&
(type > CRIME_NONE || type < NUM_CRIME_TYPES) && m_FrameCounter >= gMinTimeToNextReport[type]) {
for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) {
if (m_sPoliceRadioQueue.crimes[i].type) {
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp
index 8c0c5966..d2a82121 100644
--- a/src/control/CarAI.cpp
+++ b/src/control/CarAI.cpp
@@ -68,7 +68,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->m_bSirenOrAlarm = true;
}
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;
@@ -110,7 +110,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;
}
}
@@ -121,7 +121,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->m_nCarHornTimer = 0;
}
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;
@@ -141,7 +141,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->m_bSirenOrAlarm = true;
}
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;
@@ -169,7 +169,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;
}
}
@@ -179,7 +179,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->m_nCarHornTimer = 0;
}
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;
@@ -283,7 +283,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
(FindPlayerVehicle() == pVehicle->AutoPilot.m_pTargetCar &&
#endif
(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()))
#ifdef FIX_BUGS
)
#endif
@@ -337,7 +337,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);
@@ -351,7 +351,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;
}
}
@@ -486,7 +486,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;
default:
@@ -541,7 +541,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;
@@ -555,7 +555,7 @@ uint8 CCarAI::FindPoliceCarMissionForWantedLevel()
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;
@@ -569,7 +569,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)
@@ -586,7 +586,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)
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index edf367b8..25ced498 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -124,18 +124,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 && (
- 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, &vecTargetPos, &carClass);
- if (carClass == COPS && pWanted->m_nWantedLevel >= 1)
+ if (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;
@@ -267,7 +267,7 @@ CCarCtrl::GenerateOneRandomCar()
}
if (!ThePaths.NewGenerateCarCreationCoors(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;
int16 colliding;
CWorld::FindObjectsKindaColliding(spawnPosition, 10.0f, true, &colliding, 2, nil, false, true, true, false, false);
@@ -331,7 +331,7 @@ CCarCtrl::GenerateOneRandomCar()
}
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();
@@ -2654,7 +2654,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 (NumFiretrucksOnDuty + NumAmbulancesOnDuty + NumParkedCars + NumMissionCars +
NumLawEnforcerCars + NumRandomCars > MaxNumberOfCarsInUse)
diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp
index 59c75dd4..19e0f83d 100644
--- a/src/control/GameLogic.cpp
+++ b/src/control/GameLogic.cpp
@@ -159,7 +159,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 79c44dfd..a8e1f1cb 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -387,7 +387,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->Reset();
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_GARAGE);
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 857f74ec..96a8a670 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -129,7 +129,7 @@ CPickup::CanBePickedUp(CPlayerPed *player)
bool cannotBePickedUp =
(m_pObject->GetModelIndex() == MI_PICKUP_BODYARMOUR && player->m_fArmour > 99.5f)
|| (m_pObject->GetModelIndex() == MI_PICKUP_HEALTH && player->m_fHealth > 99.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;
}
@@ -456,7 +456,7 @@ CPickups::GivePlayerGoodiesWithPickUpMI(int16 modelIndex, int playerIndex)
DMAudio.PlayFrontEndSound(SOUND_PICKUP_BONUS, 0);
return true;
} else if (modelIndex == MI_PICKUP_BRIBE) {
- int32 level = FindPlayerPed()->m_pWanted->m_nWantedLevel - 1;
+ int32 level = FindPlayerPed()->m_pWanted->GetWantedLevel() - 1;
if (level < 0) level = 0;
player->SetWantedLevel(level);
DMAudio.PlayFrontEndSound(SOUND_PICKUP_BONUS, 0);
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 09a696cf..e435f615 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -4083,7 +4083,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 6cb078bb..9329b3bc 100644
--- a/src/control/Script2.cpp
+++ b/src/control/Script2.cpp
@@ -1033,7 +1033,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/core/Camera.cpp b/src/core/Camera.cpp
index 9d169716..2ce4e754 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -2783,7 +2783,7 @@ CCamera::TryToStartNewCamMode(int obbeMode)
if (CReplay::IsPlayingBack())
return false;
#endif
- if(FindPlayerPed()->m_pWanted->m_nWantedLevel < 1)
+ if(FindPlayerPed()->m_pWanted->GetWantedLevel() < 1)
return false;
if(FindPlayerVehicle() == nil)
return false;
@@ -2811,7 +2811,7 @@ CCamera::TryToStartNewCamMode(int obbeMode)
if (CReplay::IsPlayingBack())
return false;
#endif
- if(FindPlayerPed()->m_pWanted->m_nWantedLevel < 1)
+ if(FindPlayerPed()->m_pWanted->GetWantedLevel() < 1)
return false;
if(FindPlayerVehicle() == nil)
return false;
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 5e5f1326..95a107ee 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -226,7 +226,7 @@ void ArmourCheat()
void WantedLevelUpCheat()
{
CHud::SetHelpMessage(TheText.Get("CHEAT5"), true);
- FindPlayerPed()->SetWantedLevel(Min(FindPlayerPed()->m_pWanted->m_nWantedLevel + 2, 6));
+ FindPlayerPed()->SetWantedLevel(Min(FindPlayerPed()->m_pWanted->GetWantedLevel() + 2, 6));
}
void WantedLevelDownCheat()
diff --git a/src/core/Wanted.h b/src/core/Wanted.h
index de36c442..9f08e752 100644
--- a/src/core/Wanted.h
+++ b/src/core/Wanted.h
@@ -37,6 +37,7 @@ public:
int32 NumOfHelisRequired();
void SetWantedLevel(int32);
void SetWantedLevelNoDrop(int32 level);
+ int32 GetWantedLevel() { return m_nWantedLevel; }
void RegisterCrime(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare);
void RegisterCrime_Immediately(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare);
void ClearQdCrimes();
diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp
index e518fae4..29612ccf 100644
--- a/src/peds/CopPed.cpp
+++ b/src/peds/CopPed.cpp
@@ -179,7 +179,7 @@ CCopPed::ClearPursuit(void)
m_bZoneDisabled = false;
ClearObjective();
if (IsPedInControl()) {
- if (!m_pMyVehicle || wanted->m_nWantedLevel != 0) {
+ if (!m_pMyVehicle || wanted->GetWantedLevel() != 0) {
if (m_pMyVehicle && (m_pMyVehicle->GetPosition() - GetPosition()).MagnitudeSqr() < sq(5.0f)) {
m_nLastPedState = PED_IDLE;
SetSeek((CEntity*)m_pMyVehicle, 2.5f);
@@ -275,7 +275,7 @@ CCopPed::ScanForCrimes(void)
if (!m_bIsInPursuit) {
CPlayerPed *player = FindPlayerPed();
if ((m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER)
- && player->m_pWanted->m_nWantedLevel == 0) {
+ && player->m_pWanted->GetWantedLevel() == 0) {
if (player->m_pMyVehicle
#ifdef FIX_BUGS
@@ -291,7 +291,7 @@ void
CCopPed::CopAI(void)
{
CWanted *wanted = FindPlayerPed()->m_pWanted;
- int wantedLevel = wanted->m_nWantedLevel;
+ int wantedLevel = wanted->GetWantedLevel();
CPhysical *playerOrHisVeh = FindPlayerVehicle() ? (CPhysical*)FindPlayerVehicle() : (CPhysical*)FindPlayerPed();
if (wanted->m_bIgnoredByEveryone || wanted->m_bIgnoredByCops) {
diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp
index 46476e55..f77a64b4 100644
--- a/src/peds/PedAI.cpp
+++ b/src/peds/PedAI.cpp
@@ -832,7 +832,7 @@ CPed::ProcessObjective(void)
m_pMyVehicle->SetStatus(STATUS_PHYSICS);
m_pMyVehicle->AutoPilot.m_nPrevRouteNode = 0;
if (m_nPedType == PEDTYPE_COP) {
- m_pMyVehicle->AutoPilot.m_nCruiseSpeed = (FindPlayerPed()->m_pWanted->m_nWantedLevel * 0.1f + 0.6f) * (GAME_SPEED_TO_CARAI_SPEED * m_pMyVehicle->pHandling->Transmission.fMaxCruiseVelocity);
+ m_pMyVehicle->AutoPilot.m_nCruiseSpeed = (FindPlayerPed()->m_pWanted->GetWantedLevel() * 0.1f + 0.6f) * (GAME_SPEED_TO_CARAI_SPEED * m_pMyVehicle->pHandling->Transmission.fMaxCruiseVelocity);
m_pMyVehicle->AutoPilot.m_nCarMission = CCarAI::FindPoliceCarMissionForWantedLevel();
} else {
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = GAME_SPEED_TO_CARAI_SPEED * m_pMyVehicle->pHandling->Transmission.fMaxCruiseVelocity * 0.8f;
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp
index 53db7263..053cf5e4 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -582,7 +582,7 @@ CPopulation::AddToPopulation(float minDist, float maxDist, float minDistOffScree
CVector playerCentreOfWorld = FindPlayerCentreOfWorld(CWorld::PlayerInFocus);
CTheZones::GetZoneInfoForTimeOfDay(&playerCentreOfWorld, &zoneInfo);
CWanted *wantedInfo = playerInfo->m_pPed->m_pWanted;
- if (wantedInfo->m_nWantedLevel > 2) {
+ if (wantedInfo->GetWantedLevel() > 2) {
if (ms_nNumCop < wantedInfo->m_MaxCops && !playerInfo->m_pPed->bInVehicle
&& (CCarCtrl::NumLawEnforcerCars >= wantedInfo->m_MaximumLawEnforcerVehicles
|| CCarCtrl::NumRandomCars >= playerInfo->m_nTrafficMultiplier * CCarCtrl::CarDensityMultiplier
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index f20397a3..2f7b9001 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -655,7 +655,7 @@ void CHud::Draw()
CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString(fStarsX + SCREEN_SCALE_X_FIX(2.0f), SCREEN_SCALE_Y(87.0f) + SCREEN_SCALE_Y_FIX(2.0f), sPrintIcon);
- if (FindPlayerPed()->m_pWanted->m_nWantedLevel > i
+ if (FindPlayerPed()->m_pWanted->GetWantedLevel() > i
&& (CTimer::GetTimeInMilliseconds() > FindPlayerPed()->m_pWanted->m_nLastWantedLevelChange
+ 2000 || CTimer::GetFrameCounter() & 4)) {
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 77173538..7e8c4702 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -240,7 +240,7 @@ CAutomobile::ProcessControl(void)
// Improve grip of vehicles in certain cases
bool strongGrip1 = false;
bool strongGrip2 = false;
- if(FindPlayerVehicle() && this != FindPlayerVehicle() && FindPlayerPed()->m_pWanted->m_nWantedLevel > 3 &&
+ if(FindPlayerVehicle() && this != FindPlayerVehicle() && FindPlayerPed()->m_pWanted->GetWantedLevel() > 3 &&
(AutoPilot.m_nCarMission == MISSION_RAMPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_RAMPLAYER_CLOSE ||
AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_CLOSE) &&
FindPlayerSpeed().Magnitude() > 0.3f){
diff --git a/src/vehicles/Heli.cpp b/src/vehicles/Heli.cpp
index 44e9a73f..98e1f5fa 100644
--- a/src/vehicles/Heli.cpp
+++ b/src/vehicles/Heli.cpp
@@ -474,7 +474,7 @@ CHeli::ProcessControl(void)
// Shoot
int shootTimeout;
if (m_heliType == HELI_TYPE_RANDOM) {
- switch (FindPlayerPed()->m_pWanted->m_nWantedLevel) {
+ switch (FindPlayerPed()->m_pWanted->GetWantedLevel()) {
case 0:
case 1:
case 2: shootTimeout = 999999; break;