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 | |
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 |
-rw-r--r-- | src/audio/AudioLogic.cpp | 6 | ||||
-rw-r--r-- | src/audio/PoliceRadio.cpp | 4 | ||||
-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 | ||||
-rw-r--r-- | src/core/Camera.cpp | 4 | ||||
-rw-r--r-- | src/core/EventList.cpp | 2 | ||||
-rw-r--r-- | src/core/Pad.cpp | 4 | ||||
-rw-r--r-- | src/core/PlayerInfo.cpp | 4 | ||||
-rw-r--r-- | src/core/config.h | 22 | ||||
-rw-r--r-- | src/peds/CopPed.cpp | 6 | ||||
-rw-r--r-- | src/peds/PedAI.cpp | 2 | ||||
-rw-r--r-- | src/peds/PlayerPed.cpp | 2 | ||||
-rw-r--r-- | src/peds/Population.cpp | 2 | ||||
-rw-r--r-- | src/render/Hud.cpp | 8 | ||||
-rw-r--r-- | src/save/GenericGameStorage.cpp | 2 | ||||
-rw-r--r-- | src/vehicles/Boat.cpp | 4 | ||||
-rw-r--r-- | src/vehicles/Heli.cpp | 2 | ||||
-rw-r--r-- | src/vehicles/Vehicle.cpp | 4 |
25 files changed, 77 insertions, 77 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index b5127fc5..7d759279 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -305,11 +305,11 @@ cAudioManager::ProcessPlayerMood() playerPed = FindPlayerPed(); if (playerPed != nil) { - if (playerPed->m_pWanted->m_nWantedLevel > 3) { + if (playerPed->m_pWanted->GetWantedLevel() > 3) { m_nPlayerMood = PLAYER_MOOD_ANGRY; return; } - if (playerPed->m_pWanted->m_nWantedLevel > 1) { + if (playerPed->m_pWanted->GetWantedLevel() > 1) { m_nPlayerMood = PLAYER_MOOD_PISSED_OFF; return; } @@ -5678,7 +5678,7 @@ cAudioManager::GetCopTalkSfx(CPed *ped, int16 sound) case SOUND_PED_ATTACK: GetPhrase(sfx, ped->m_lastComment, 8494, 4); break; case SOUND_PED_EVADE: GetPhrase(sfx, ped->m_lastComment, 8491, 3); break; case SOUND_PED_PED_COLLISION: - if(FindPlayerPed()->m_pWanted->m_nWantedLevel <= 0) return NO_SAMPLE; + if(FindPlayerPed()->m_pWanted->GetWantedLevel() <= 0) return NO_SAMPLE; GetPhrase(sfx, ped->m_lastComment, 8476, 5); break; default: return GetGenericMaleTalkSfx(ped, sound); diff --git a/src/audio/PoliceRadio.cpp b/src/audio/PoliceRadio.cpp index 30fcbde0..cf6f5bee 100644 --- a/src/audio/PoliceRadio.cpp +++ b/src/audio/PoliceRadio.cpp @@ -136,7 +136,7 @@ cAudioManager::ServicePoliceRadio() #endif CPlayerPed *playerPed = FindPlayerPed(); if (playerPed) { - wantedLevel = playerPed->m_pWanted->m_nWantedLevel; + wantedLevel = playerPed->m_pWanted->GetWantedLevel(); if (!crimeReport) { if (wantedLevel != 0) { if (nLastSeen != 0) @@ -653,7 +653,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 != CRIME_NONE) { 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; diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 7a9d3247..25d2e5c3 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -2954,7 +2954,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; @@ -2982,7 +2982,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/EventList.cpp b/src/core/EventList.cpp index 8e639656..160adab2 100644 --- a/src/core/EventList.cpp +++ b/src/core/EventList.cpp @@ -220,7 +220,7 @@ CEventList::ReportCrimeForEvent(eEventType type, intptr crimeId, bool copsDontCa default: crime = CRIME_NONE; break; } - if (crime == CRIME_HIT_PED && IsPedPointerValid((CPed*)crimeId) && FindPlayerPed()->m_pWanted->m_nWantedLevel == 0 && ((CPed*)crimeId)->bBeingChasedByPolice) { + if (crime == CRIME_HIT_PED && IsPedPointerValid((CPed*)crimeId) && FindPlayerPed()->m_pWanted->GetWantedLevel() == 0 && ((CPed*)crimeId)->bBeingChasedByPolice) { if (!((CPed*)crimeId)->DyingOrDead()) { CMessages::AddBigMessage(TheText.Get("GOODBOY"), 5000, 0); CWorld::Players[CWorld::PlayerInFocus].m_nMoney += 50; diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 23c2f896..402c6c74 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -70,7 +70,7 @@ bool CPad::bOldDisplayNoControllerMessage; bool CPad::m_bMapPadOneToPadTwo; bool CPad::m_bDebugCamPCOn; bool CPad::bHasPlayerCheated; -bool CPad::bInvertLook4Pad; +bool CPad::bInvertLook4Pad = true; #ifdef GTA_PS2 unsigned char act_direct[6]; unsigned char act_align[6]; @@ -457,7 +457,7 @@ void ArmourCheat() void WantedLevelUpCheat() { CHud::SetHelpMessage(TheText.Get("CHEAT5"), true); - FindPlayerPed()->m_pWanted->CheatWantedLevel(Min(FindPlayerPed()->m_pWanted->m_nWantedLevel + 2, 6)); + FindPlayerPed()->m_pWanted->CheatWantedLevel(Min(FindPlayerPed()->m_pWanted->GetWantedLevel() + 2, 6)); } void WantedLevelDownCheat() diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp index f0f3e2c6..32b2f853 100644 --- a/src/core/PlayerInfo.cpp +++ b/src/core/PlayerInfo.cpp @@ -481,7 +481,7 @@ CPlayerInfo::Process(void) CStats::DistanceTravelledOnFoot += FindPlayerPed()->m_fDistanceTravelled; } - if (m_pPed->m_pWanted->m_nWantedLevel && !CTheScripts::IsPlayerOnAMission()) { + if (m_pPed->m_pWanted->GetWantedLevel() && !CTheScripts::IsPlayerOnAMission()) { float maxDelta = 0.0f; static bool movedSignificantly = true; static bool thereIsACarPathNear = true; @@ -493,7 +493,7 @@ CPlayerInfo::Process(void) lastPlayerPos = FindPlayerCoors(); thereIsACarPathNear = ThePaths.FindNodeClosestToCoors(FindPlayerCoors(), PATH_CAR, 60.0f, true, false, false, false) != 0; } - switch (m_pPed->m_pWanted->m_nWantedLevel) { + switch (m_pPed->m_pWanted->GetWantedLevel()) { case 1: maxDelta = 31.f; break; diff --git a/src/core/config.h b/src/core/config.h index ef282b25..6a604f95 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -157,7 +157,7 @@ enum Config { // This is enabled for all released games. // any debug stuff that isn't left in any game is not in FINAL -//#define FINAL +#define FINAL // This is enabled for all released games except mobile // any debug stuff that is only left in mobile, is not in MASTER @@ -190,7 +190,7 @@ enum Config { #define NO_CDCHECK // those infamous texts -#define DRAW_GAME_VERSION_TEXT +//#define DRAW_GAME_VERSION_TEXT // Memory allocation and compression // #define USE_CUSTOM_ALLOCATOR // use CMemoryHeap for allocation. use with care, not finished yet @@ -223,7 +223,7 @@ enum Config { #undef DRAW_GAME_VERSION_TEXT #else // not in master builds - #define VALIDATE_SAVE_SIZE +// #define VALIDATE_SAVE_SIZE #define NO_MOVIES // disable intro videos #define DEBUGMENU @@ -231,7 +231,7 @@ enum Config { #ifdef FINAL // in all games -# define USE_MY_DOCUMENTS // use my documents directory for user files +//# define USE_MY_DOCUMENTS // use my documents directory for user files #else // not in any game # define CHATTYSPLASH // print what the game is loading @@ -240,7 +240,7 @@ enum Config { #define FIX_BUGS // fixes bugs that we've came across during reversing. You can undefine this only on release builds. //#define MORE_LANGUAGES // Add more translations to the game -#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible +//#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible #define LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS #define FIX_HIGH_FPS_BUGS_ON_FRONTEND @@ -311,8 +311,8 @@ enum Config { //# define PS2_MENU_USEALLPAGEICONS #else # define MAP_ENHANCEMENTS // Adding waypoint and better mouse support -# define TRIANGLE_BACK_BUTTON -//# define CIRCLE_BACK_BUTTON +//# define TRIANGLE_BACK_BUTTON +# define CIRCLE_BACK_BUTTON #define LEGACY_MENU_OPTIONS // i.e. frame sync(vsync) #define MUCH_SHORTER_OUTRO_SCREEN // #define XBOX_MESSAGE_SCREEN // Blue background, no "saved successfully press OK" screen etc. @@ -341,11 +341,11 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually //#define MISSION_REPLAY // mobile feature #endif //#define SIMPLIER_MISSIONS // apply simplifications from mobile -#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT +// #define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT #define SCRIPT_LOG_FILE_LEVEL 0 // 0 == no log, 1 == overwrite every frame, 2 == full log #ifndef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT -#define USE_BASIC_SCRIPT_DEBUG_OUTPUT +// #define USE_BASIC_SCRIPT_DEBUG_OUTPUT #endif #ifdef MASTER @@ -366,7 +366,7 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually #define CAMERA_PICKUP // Peds -#define CANCELLABLE_CAR_ENTER +//#define CANCELLABLE_CAR_ENTER // Camera #define IMPROVED_CAMERA // Better Debug cam, and maybe more in the future @@ -374,7 +374,7 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually // Audio #define AUDIO_CACHE // cache sound lengths to speed up the cold boot -//#define PS2_AUDIO_PATHS // changes audio paths for cutscenes and radio to PS2 paths (needs vbdec on MSS builds) +#define PS2_AUDIO_PATHS // changes audio paths for cutscenes and radio to PS2 paths (needs vbdec on MSS builds) //#define AUDIO_OAL_USE_SNDFILE // use libsndfile to decode WAVs instead of our internal decoder #define AUDIO_OAL_USE_MPG123 // use mpg123 to support mp3 files diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp index 762c7f1a..3b777394 100644 --- a/src/peds/CopPed.cpp +++ b/src/peds/CopPed.cpp @@ -196,7 +196,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); @@ -295,7 +295,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 @@ -311,7 +311,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 68983dac..04e6f596 100644 --- a/src/peds/PedAI.cpp +++ b/src/peds/PedAI.cpp @@ -924,7 +924,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/PlayerPed.cpp b/src/peds/PlayerPed.cpp index f07d1ac7..b66c1854 100644 --- a/src/peds/PlayerPed.cpp +++ b/src/peds/PlayerPed.cpp @@ -1654,7 +1654,7 @@ CPlayerPed::ProcessControl(void) if (m_nEvadeAmount == 0) m_pEvadingFrom = nil; - if (m_pWanted->m_nWantedLevel > 0) + if (m_pWanted->GetWantedLevel() > 0) FindNewAttackPoints(); UpdateMeleeAttackers(); diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp index f886597f..b1943358 100644 --- a/src/peds/Population.cpp +++ b/src/peds/Population.cpp @@ -537,7 +537,7 @@ CPopulation::AddToPopulation(float minDist, float maxDist, float minDistOffScree CTheZones::GetZoneInfoForTimeOfDay(&playerCentreOfWorld, &zoneInfo); CWanted *wantedInfo = playerInfo->m_pPed->m_pWanted; - if (wantedInfo->m_nWantedLevel > 2) { + if (wantedInfo->GetWantedLevel() > 2) { if (!CGame::IsInInterior() && (CGeneral::GetRandomNumber() % 32 == 0) && FindPlayerVehicle()) forceAddingCop = true; diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp index 238dfbb5..b7decdb3 100644 --- a/src/render/Hud.cpp +++ b/src/render/Hud.cpp @@ -619,11 +619,11 @@ void CHud::Draw() /* DrawWantedLevel */ - if (m_LastWanted == playerPed->m_pWanted->m_nWantedLevel) { + if (m_LastWanted == playerPed->m_pWanted->GetWantedLevel()) { alpha = DrawFadeState(HUD_WANTED_FADING, 0); } else { alpha = DrawFadeState(HUD_WANTED_FADING, 1); - m_LastWanted = playerPed->m_pWanted->m_nWantedLevel; + m_LastWanted = playerPed->m_pWanted->GetWantedLevel(); } if (m_WantedState != FADED_OUT) { @@ -639,7 +639,7 @@ void CHud::Draw() for (int i = 0; i < 6; i++) { if (FrontEndMenuManager.m_PrefsShowHud) { - if (playerPed->m_pWanted->m_nWantedLevel > i + if (playerPed->m_pWanted->GetWantedLevel() > i && (CTimer::GetTimeInMilliseconds() > playerPed->m_pWanted->m_nLastWantedLevelChange + 2000 || CTimer::GetFrameCounter() & 4)) { @@ -652,7 +652,7 @@ void CHud::Draw() CFont::SetColor(WANTED_COLOR_FLASH); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f + 23.0f * i), SCREEN_SCALE_Y(87.0f), sPrintIcon); - } else if (playerPed->m_pWanted->m_nWantedLevel <= i) { + } else if (playerPed->m_pWanted->GetWantedLevel() <= i) { NOTWANTED_COLOR.a = alpha; CFont::SetColor(NOTWANTED_COLOR); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f + 23.0f * i), SCREEN_SCALE_Y(87.0f), sPrintIcon); diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp index b0cf1d98..bbf136bf 100644 --- a/src/save/GenericGameStorage.cpp +++ b/src/save/GenericGameStorage.cpp @@ -347,7 +347,7 @@ GenericLoad() #endif ReadDataFromBufferPointer(buf, CGame::currArea); ReadDataFromBufferPointer(buf, CVehicle::bAllTaxisHaveNitro); - ReadDataFromBufferPointer(buf, CPad::bInvertLook4Pad); + buf += align4bytes(sizeof(CPad::bInvertLook4Pad)); ReadDataFromBufferPointer(buf, CTimeCycle::m_ExtraColour); ReadDataFromBufferPointer(buf, CTimeCycle::m_bExtraColourOn); ReadDataFromBufferPointer(buf, CTimeCycle::m_ExtraColourInter); diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp index 0e978570..807b43b1 100644 --- a/src/vehicles/Boat.cpp +++ b/src/vehicles/Boat.cpp @@ -135,9 +135,9 @@ CBoat::ProcessControl(void) m_fBuoyancy *= 0.99f; #ifdef FIX_BUGS - if(FindPlayerPed() && FindPlayerPed()->m_pWanted->m_nWantedLevel > 0 && GetModelIndex() == MI_PREDATOR){ + if(FindPlayerPed() && FindPlayerPed()->m_pWanted->GetWantedLevel() > 0 && GetModelIndex() == MI_PREDATOR){ #else - if(FindPlayerPed()->m_pWanted->m_nWantedLevel > 0 && GetModelIndex() == MI_PREDATOR){ + if(FindPlayerPed()->m_pWanted->GetWantedLevel() > 0 && GetModelIndex() == MI_PREDATOR){ #endif CVehicle *playerVeh = FindPlayerVehicle(); if(playerVeh && playerVeh->GetVehicleAppearance() == VEHICLE_APPEARANCE_BOAT && diff --git a/src/vehicles/Heli.cpp b/src/vehicles/Heli.cpp index 1c1b2617..fc4f7bac 100644 --- a/src/vehicles/Heli.cpp +++ b/src/vehicles/Heli.cpp @@ -480,7 +480,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; diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index a464c128..cda21563 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -1495,7 +1495,7 @@ CVehicle::MakeNonDraggedPedsLeaveVehicle(CPed *ped1, CPed *ped2, CPlayerPed *&pl cop = nil; if(ped1->IsPlayer() && ped2->m_nPedType == PEDTYPE_COP && - ((CPlayerPed*)ped1)->m_pWanted->m_nWantedLevel > 0 && + ((CPlayerPed*)ped1)->m_pWanted->GetWantedLevel() > 0 && ped2->m_pedInObjective == ped1){ player = (CPlayerPed*)ped1; cop = (CCopPed*)ped2; @@ -1525,7 +1525,7 @@ CVehicle::MakeNonDraggedPedsLeaveVehicle(CPed *ped1, CPed *ped2, CPlayerPed *&pl int numPeds3 = 0; for(i = 0; i < numPeds; i++){ if(peds[i]->IsPlayer() && ped2->m_nPedType == PEDTYPE_COP && - ((CPlayerPed*)peds[i])->m_pWanted->m_nWantedLevel > 0 && + ((CPlayerPed*)peds[i])->m_pWanted->GetWantedLevel() > 0 && ped2->m_pedInObjective == peds[i]){ player = (CPlayerPed*)peds[i]; cop = (CCopPed*)ped2; |