mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-10-31 23:35:55 +00:00
Merge pull request #973 from withmorten/wantedlevel
m_nWantedLevel -> GetWantedLevel()
This commit is contained in:
commit
d77846bb16
|
@ -161,7 +161,7 @@ cAudioManager::ServicePoliceRadio()
|
||||||
if(CReplay::IsPlayingBack() || !FindPlayerPed() || !FindPlayerPed()->m_pWanted)
|
if(CReplay::IsPlayingBack() || !FindPlayerPed() || !FindPlayerPed()->m_pWanted)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
wantedLevel = FindPlayerPed()->m_pWanted->m_nWantedLevel;
|
wantedLevel = FindPlayerPed()->m_pWanted->GetWantedLevel();
|
||||||
if(!crimeReport) {
|
if(!crimeReport) {
|
||||||
if(wantedLevel != 0) {
|
if(wantedLevel != 0) {
|
||||||
if(nLastSeen != 0) {
|
if(nLastSeen != 0) {
|
||||||
|
@ -679,7 +679,7 @@ void
|
||||||
cAudioManager::ReportCrime(eCrimeType type, const CVector &pos)
|
cAudioManager::ReportCrime(eCrimeType type, const CVector &pos)
|
||||||
{
|
{
|
||||||
int32 lastCrime = ARRAY_SIZE(m_sPoliceRadioQueue.crimes);
|
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]) {
|
(type > CRIME_NONE || type < NUM_CRIME_TYPES) && m_FrameCounter >= gMinTimeToNextReport[type]) {
|
||||||
for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) {
|
for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) {
|
||||||
if (m_sPoliceRadioQueue.crimes[i].type) {
|
if (m_sPoliceRadioQueue.crimes[i].type) {
|
||||||
|
|
|
@ -68,7 +68,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||||
pVehicle->m_bSirenOrAlarm = true;
|
pVehicle->m_bSirenOrAlarm = true;
|
||||||
}
|
}
|
||||||
if (FindPlayerPed()->m_pWanted->m_bIgnoredByEveryone || pVehicle->bIsLawEnforcer &&
|
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);
|
CCarCtrl::JoinCarWithRoadSystem(pVehicle);
|
||||||
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
||||||
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS;
|
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS;
|
||||||
|
@ -110,7 +110,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||||
TellOccupantsToLeaveCar(pVehicle);
|
TellOccupantsToLeaveCar(pVehicle);
|
||||||
pVehicle->AutoPilot.m_nCruiseSpeed = 0;
|
pVehicle->AutoPilot.m_nCruiseSpeed = 0;
|
||||||
pVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
|
pVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
|
||||||
if (FindPlayerPed()->m_pWanted->m_nWantedLevel <= 1)
|
if (FindPlayerPed()->m_pWanted->GetWantedLevel() <= 1)
|
||||||
pVehicle->m_bSirenOrAlarm = false;
|
pVehicle->m_bSirenOrAlarm = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||||
pVehicle->m_nCarHornTimer = 0;
|
pVehicle->m_nCarHornTimer = 0;
|
||||||
}
|
}
|
||||||
if (FindPlayerPed()->m_pWanted->m_bIgnoredByEveryone || pVehicle->bIsLawEnforcer &&
|
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);
|
CCarCtrl::JoinCarWithRoadSystem(pVehicle);
|
||||||
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
||||||
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS;
|
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS;
|
||||||
|
@ -141,7 +141,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||||
pVehicle->m_bSirenOrAlarm = true;
|
pVehicle->m_bSirenOrAlarm = true;
|
||||||
}
|
}
|
||||||
if (FindPlayerPed()->m_pWanted->m_bIgnoredByEveryone || pVehicle->bIsLawEnforcer &&
|
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);
|
CCarCtrl::JoinCarWithRoadSystem(pVehicle);
|
||||||
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
||||||
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS;
|
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS;
|
||||||
|
@ -169,7 +169,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||||
TellOccupantsToLeaveCar(pVehicle);
|
TellOccupantsToLeaveCar(pVehicle);
|
||||||
pVehicle->AutoPilot.m_nCruiseSpeed = 0;
|
pVehicle->AutoPilot.m_nCruiseSpeed = 0;
|
||||||
pVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
|
pVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
|
||||||
if (FindPlayerPed()->m_pWanted->m_nWantedLevel <= 1)
|
if (FindPlayerPed()->m_pWanted->GetWantedLevel() <= 1)
|
||||||
pVehicle->m_bSirenOrAlarm = false;
|
pVehicle->m_bSirenOrAlarm = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||||
pVehicle->m_nCarHornTimer = 0;
|
pVehicle->m_nCarHornTimer = 0;
|
||||||
}
|
}
|
||||||
if (FindPlayerPed()->m_pWanted->m_bIgnoredByEveryone || pVehicle->bIsLawEnforcer &&
|
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);
|
CCarCtrl::JoinCarWithRoadSystem(pVehicle);
|
||||||
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
||||||
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS;
|
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS;
|
||||||
|
@ -283,7 +283,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||||
(FindPlayerVehicle() == pVehicle->AutoPilot.m_pTargetCar &&
|
(FindPlayerVehicle() == pVehicle->AutoPilot.m_pTargetCar &&
|
||||||
#endif
|
#endif
|
||||||
(FindPlayerPed()->m_pWanted->m_bIgnoredByEveryone || pVehicle->bIsLawEnforcer &&
|
(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
|
#ifdef FIX_BUGS
|
||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
|
@ -337,7 +337,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
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 ||
|
if (ABS(FindPlayerCoors().x - pVehicle->GetPosition().x) > 10.0f ||
|
||||||
ABS(FindPlayerCoors().y - pVehicle->GetPosition().y) > 10.0f){
|
ABS(FindPlayerCoors().y - pVehicle->GetPosition().y) > 10.0f){
|
||||||
pVehicle->AutoPilot.m_nCruiseSpeed = FindPoliceCarSpeedForWantedLevel(pVehicle);
|
pVehicle->AutoPilot.m_nCruiseSpeed = FindPoliceCarSpeedForWantedLevel(pVehicle);
|
||||||
|
@ -351,7 +351,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||||
TellOccupantsToLeaveCar(pVehicle);
|
TellOccupantsToLeaveCar(pVehicle);
|
||||||
pVehicle->AutoPilot.m_nCruiseSpeed = 0;
|
pVehicle->AutoPilot.m_nCruiseSpeed = 0;
|
||||||
pVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
|
pVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
|
||||||
if (FindPlayerPed()->m_pWanted->m_nWantedLevel <= 1)
|
if (FindPlayerPed()->m_pWanted->GetWantedLevel() <= 1)
|
||||||
pVehicle->m_bSirenOrAlarm = false;
|
pVehicle->m_bSirenOrAlarm = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -486,7 +486,7 @@ void CCarAI::AddPoliceCarOccupants(CVehicle* pVehicle)
|
||||||
case MI_RHINO:
|
case MI_RHINO:
|
||||||
case MI_BARRACKS:
|
case MI_BARRACKS:
|
||||||
pVehicle->SetUpDriver();
|
pVehicle->SetUpDriver();
|
||||||
if (FindPlayerPed()->m_pWanted->m_nWantedLevel > 1)
|
if (FindPlayerPed()->m_pWanted->GetWantedLevel() > 1)
|
||||||
pVehicle->SetupPassenger(0);
|
pVehicle->SetupPassenger(0);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
|
@ -541,7 +541,7 @@ void CCarAI::TellCarToBlockOtherCar(CVehicle* pVehicle, CVehicle* pTarget)
|
||||||
|
|
||||||
uint8 CCarAI::FindPoliceCarMissionForWantedLevel()
|
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 0:
|
||||||
case 1: return MISSION_BLOCKPLAYER_FARAWAY;
|
case 1: return MISSION_BLOCKPLAYER_FARAWAY;
|
||||||
case 2: return (CGeneral::GetRandomNumber() & 3) >= 3 ? MISSION_RAMPLAYER_FARAWAY : 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)
|
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 0: return CGeneral::GetRandomNumberInRange(12, 16);
|
||||||
case 1: return 25;
|
case 1: return 25;
|
||||||
case 2: return 34;
|
case 2: return 34;
|
||||||
|
@ -569,7 +569,7 @@ int32 CCarAI::FindPoliceCarSpeedForWantedLevel(CVehicle* pVehicle)
|
||||||
|
|
||||||
void CCarAI::MellowOutChaseSpeed(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();
|
float distanceToPlayer = (pVehicle->GetPosition() - FindPlayerCoors()).Magnitude();
|
||||||
if (FindPlayerVehicle()){
|
if (FindPlayerVehicle()){
|
||||||
if (distanceToPlayer < 10.0f)
|
if (distanceToPlayer < 10.0f)
|
||||||
|
@ -586,7 +586,7 @@ void CCarAI::MellowOutChaseSpeed(CVehicle* pVehicle)
|
||||||
else
|
else
|
||||||
pVehicle->AutoPilot.m_nCruiseSpeed = 25;
|
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();
|
float distanceToPlayer = (pVehicle->GetPosition() - FindPlayerCoors()).Magnitude();
|
||||||
if (FindPlayerVehicle()) {
|
if (FindPlayerVehicle()) {
|
||||||
if (distanceToPlayer < 10.0f)
|
if (distanceToPlayer < 10.0f)
|
||||||
|
|
|
@ -124,18 +124,18 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
CWanted* pWanted = pPlayer->m_pPed->m_pWanted;
|
CWanted* pWanted = pPlayer->m_pPed->m_pWanted;
|
||||||
int carClass;
|
int carClass;
|
||||||
int carModel;
|
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_CurrentCops < pWanted->m_MaxCops && (
|
||||||
pWanted->m_nWantedLevel > 3 ||
|
pWanted->GetWantedLevel() > 3 ||
|
||||||
pWanted->m_nWantedLevel > 2 && CTimer::GetTimeInMilliseconds() > LastTimeLawEnforcerCreated + 5000 ||
|
pWanted->GetWantedLevel() > 2 && CTimer::GetTimeInMilliseconds() > LastTimeLawEnforcerCreated + 5000 ||
|
||||||
pWanted->m_nWantedLevel > 1 && CTimer::GetTimeInMilliseconds() > LastTimeLawEnforcerCreated + 8000)) {
|
pWanted->GetWantedLevel() > 1 && CTimer::GetTimeInMilliseconds() > LastTimeLawEnforcerCreated + 8000)) {
|
||||||
/* Last pWanted->m_nWantedLevel > 1 is unnecessary but I added it for better readability. */
|
/* 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. */
|
/* Wouldn't be surprised it was there originally but was optimized out. */
|
||||||
carClass = COPS;
|
carClass = COPS;
|
||||||
carModel = ChoosePoliceCarModel();
|
carModel = ChoosePoliceCarModel();
|
||||||
}else{
|
}else{
|
||||||
carModel = ChooseModel(&zone, &vecTargetPos, &carClass);
|
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. */
|
/* 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. */
|
/* In particular it means that cop cars never spawn if player has wanted level of 1. */
|
||||||
return;
|
return;
|
||||||
|
@ -267,7 +267,7 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
}
|
}
|
||||||
if (!ThePaths.NewGenerateCarCreationCoors(vecTargetPos.x, vecTargetPos.y, frontX, frontY,
|
if (!ThePaths.NewGenerateCarCreationCoors(vecTargetPos.x, vecTargetPos.y, frontX, frontY,
|
||||||
preferredDistance, angleLimit, invertAngleLimitTest, &spawnPosition, &curNodeId, &nextNodeId,
|
preferredDistance, angleLimit, invertAngleLimitTest, &spawnPosition, &curNodeId, &nextNodeId,
|
||||||
&positionBetweenNodes, carClass == COPS && pWanted->m_nWantedLevel >= 1))
|
&positionBetweenNodes, carClass == COPS && pWanted->GetWantedLevel() >= 1))
|
||||||
return;
|
return;
|
||||||
int16 colliding;
|
int16 colliding;
|
||||||
CWorld::FindObjectsKindaColliding(spawnPosition, 10.0f, true, &colliding, 2, nil, false, true, true, false, false);
|
CWorld::FindObjectsKindaColliding(spawnPosition, 10.0f, true, &colliding, 2, nil, false, true, true, false, false);
|
||||||
|
@ -331,7 +331,7 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
}
|
}
|
||||||
case COPS:
|
case COPS:
|
||||||
pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE;
|
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_nCruiseSpeed = CCarAI::FindPoliceCarSpeedForWantedLevel(pVehicle);
|
||||||
pVehicle->AutoPilot.m_fMaxTrafficSpeed = pVehicle->AutoPilot.m_nCruiseSpeed / 2;
|
pVehicle->AutoPilot.m_fMaxTrafficSpeed = pVehicle->AutoPilot.m_nCruiseSpeed / 2;
|
||||||
pVehicle->AutoPilot.m_nCarMission = CCarAI::FindPoliceCarMissionForWantedLevel();
|
pVehicle->AutoPilot.m_nCarMission = CCarAI::FindPoliceCarMissionForWantedLevel();
|
||||||
|
@ -2654,7 +2654,7 @@ void CCarCtrl::FindLinksToGoWithTheseNodes(CVehicle* pVehicle)
|
||||||
|
|
||||||
void CCarCtrl::GenerateEmergencyServicesCar(void)
|
void CCarCtrl::GenerateEmergencyServicesCar(void)
|
||||||
{
|
{
|
||||||
if (FindPlayerPed()->m_pWanted->m_nWantedLevel > 3)
|
if (FindPlayerPed()->m_pWanted->GetWantedLevel() > 3)
|
||||||
return;
|
return;
|
||||||
if (NumFiretrucksOnDuty + NumAmbulancesOnDuty + NumParkedCars + NumMissionCars +
|
if (NumFiretrucksOnDuty + NumAmbulancesOnDuty + NumParkedCars + NumMissionCars +
|
||||||
NumLawEnforcerCars + NumRandomCars > MaxNumberOfCarsInUse)
|
NumLawEnforcerCars + NumRandomCars > MaxNumberOfCarsInUse)
|
||||||
|
|
|
@ -159,7 +159,7 @@ CGameLogic::Update()
|
||||||
pPlayerInfo.m_WBState = WBSTATE_PLAYING;
|
pPlayerInfo.m_WBState = WBSTATE_PLAYING;
|
||||||
int takeMoney;
|
int takeMoney;
|
||||||
|
|
||||||
switch (pPlayerInfo.m_pPed->m_pWanted->m_nWantedLevel) {
|
switch (pPlayerInfo.m_pPed->m_pWanted->GetWantedLevel()) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
takeMoney = 100;
|
takeMoney = 100;
|
||||||
|
|
|
@ -387,7 +387,7 @@ void CGarage::Update()
|
||||||
m_eGarageState = GS_OPENING;
|
m_eGarageState = GS_OPENING;
|
||||||
DMAudio.PlayFrontEndSound(SOUND_GARAGE_OPENING, 1);
|
DMAudio.PlayFrontEndSound(SOUND_GARAGE_OPENING, 1);
|
||||||
bool bTakeMoney = false;
|
bool bTakeMoney = false;
|
||||||
if (FindPlayerPed()->m_pWanted->m_nWantedLevel != 0)
|
if (FindPlayerPed()->m_pWanted->GetWantedLevel() != 0)
|
||||||
bTakeMoney = true;
|
bTakeMoney = true;
|
||||||
FindPlayerPed()->m_pWanted->Reset();
|
FindPlayerPed()->m_pWanted->Reset();
|
||||||
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_GARAGE);
|
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_GARAGE);
|
||||||
|
|
|
@ -129,7 +129,7 @@ CPickup::CanBePickedUp(CPlayerPed *player)
|
||||||
bool cannotBePickedUp =
|
bool cannotBePickedUp =
|
||||||
(m_pObject->GetModelIndex() == MI_PICKUP_BODYARMOUR && player->m_fArmour > 99.5f)
|
(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_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));
|
|| (m_pObject->GetModelIndex() == MI_PICKUP_KILLFRENZY && (CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame));
|
||||||
return !cannotBePickedUp;
|
return !cannotBePickedUp;
|
||||||
}
|
}
|
||||||
|
@ -456,7 +456,7 @@ CPickups::GivePlayerGoodiesWithPickUpMI(int16 modelIndex, int playerIndex)
|
||||||
DMAudio.PlayFrontEndSound(SOUND_PICKUP_BONUS, 0);
|
DMAudio.PlayFrontEndSound(SOUND_PICKUP_BONUS, 0);
|
||||||
return true;
|
return true;
|
||||||
} else if (modelIndex == MI_PICKUP_BRIBE) {
|
} 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;
|
if (level < 0) level = 0;
|
||||||
player->SetWantedLevel(level);
|
player->SetWantedLevel(level);
|
||||||
DMAudio.PlayFrontEndSound(SOUND_PICKUP_BONUS, 0);
|
DMAudio.PlayFrontEndSound(SOUND_PICKUP_BONUS, 0);
|
||||||
|
|
|
@ -4083,7 +4083,7 @@ int8 CRunningScript::ProcessCommands200To299(int32 command)
|
||||||
return 0;
|
return 0;
|
||||||
case COMMAND_IS_WANTED_LEVEL_GREATER:
|
case COMMAND_IS_WANTED_LEVEL_GREATER:
|
||||||
CollectParameters(&m_nIp, 2);
|
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;
|
return 0;
|
||||||
case COMMAND_CLEAR_WANTED_LEVEL:
|
case COMMAND_CLEAR_WANTED_LEVEL:
|
||||||
CollectParameters(&m_nIp, 1);
|
CollectParameters(&m_nIp, 1);
|
||||||
|
|
|
@ -1033,7 +1033,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command)
|
||||||
CollectParameters(&m_nIp, 1);
|
CollectParameters(&m_nIp, 1);
|
||||||
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
||||||
script_assert(pPed);
|
script_assert(pPed);
|
||||||
ScriptParams[0] = pPed->m_pWanted->m_nWantedLevel;
|
ScriptParams[0] = pPed->m_pWanted->GetWantedLevel();
|
||||||
StoreParameters(&m_nIp, 1);
|
StoreParameters(&m_nIp, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2783,7 +2783,7 @@ CCamera::TryToStartNewCamMode(int obbeMode)
|
||||||
if (CReplay::IsPlayingBack())
|
if (CReplay::IsPlayingBack())
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
if(FindPlayerPed()->m_pWanted->m_nWantedLevel < 1)
|
if(FindPlayerPed()->m_pWanted->GetWantedLevel() < 1)
|
||||||
return false;
|
return false;
|
||||||
if(FindPlayerVehicle() == nil)
|
if(FindPlayerVehicle() == nil)
|
||||||
return false;
|
return false;
|
||||||
|
@ -2811,7 +2811,7 @@ CCamera::TryToStartNewCamMode(int obbeMode)
|
||||||
if (CReplay::IsPlayingBack())
|
if (CReplay::IsPlayingBack())
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
if(FindPlayerPed()->m_pWanted->m_nWantedLevel < 1)
|
if(FindPlayerPed()->m_pWanted->GetWantedLevel() < 1)
|
||||||
return false;
|
return false;
|
||||||
if(FindPlayerVehicle() == nil)
|
if(FindPlayerVehicle() == nil)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -226,7 +226,7 @@ void ArmourCheat()
|
||||||
void WantedLevelUpCheat()
|
void WantedLevelUpCheat()
|
||||||
{
|
{
|
||||||
CHud::SetHelpMessage(TheText.Get("CHEAT5"), true);
|
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()
|
void WantedLevelDownCheat()
|
||||||
|
|
|
@ -37,6 +37,7 @@ public:
|
||||||
int32 NumOfHelisRequired();
|
int32 NumOfHelisRequired();
|
||||||
void SetWantedLevel(int32);
|
void SetWantedLevel(int32);
|
||||||
void SetWantedLevelNoDrop(int32 level);
|
void SetWantedLevelNoDrop(int32 level);
|
||||||
|
int32 GetWantedLevel() { return m_nWantedLevel; }
|
||||||
void RegisterCrime(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare);
|
void RegisterCrime(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare);
|
||||||
void RegisterCrime_Immediately(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare);
|
void RegisterCrime_Immediately(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare);
|
||||||
void ClearQdCrimes();
|
void ClearQdCrimes();
|
||||||
|
|
|
@ -179,7 +179,7 @@ CCopPed::ClearPursuit(void)
|
||||||
m_bZoneDisabled = false;
|
m_bZoneDisabled = false;
|
||||||
ClearObjective();
|
ClearObjective();
|
||||||
if (IsPedInControl()) {
|
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)) {
|
if (m_pMyVehicle && (m_pMyVehicle->GetPosition() - GetPosition()).MagnitudeSqr() < sq(5.0f)) {
|
||||||
m_nLastPedState = PED_IDLE;
|
m_nLastPedState = PED_IDLE;
|
||||||
SetSeek((CEntity*)m_pMyVehicle, 2.5f);
|
SetSeek((CEntity*)m_pMyVehicle, 2.5f);
|
||||||
|
@ -275,7 +275,7 @@ CCopPed::ScanForCrimes(void)
|
||||||
if (!m_bIsInPursuit) {
|
if (!m_bIsInPursuit) {
|
||||||
CPlayerPed *player = FindPlayerPed();
|
CPlayerPed *player = FindPlayerPed();
|
||||||
if ((m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER)
|
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
|
if (player->m_pMyVehicle
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
|
@ -291,7 +291,7 @@ void
|
||||||
CCopPed::CopAI(void)
|
CCopPed::CopAI(void)
|
||||||
{
|
{
|
||||||
CWanted *wanted = FindPlayerPed()->m_pWanted;
|
CWanted *wanted = FindPlayerPed()->m_pWanted;
|
||||||
int wantedLevel = wanted->m_nWantedLevel;
|
int wantedLevel = wanted->GetWantedLevel();
|
||||||
CPhysical *playerOrHisVeh = FindPlayerVehicle() ? (CPhysical*)FindPlayerVehicle() : (CPhysical*)FindPlayerPed();
|
CPhysical *playerOrHisVeh = FindPlayerVehicle() ? (CPhysical*)FindPlayerVehicle() : (CPhysical*)FindPlayerPed();
|
||||||
|
|
||||||
if (wanted->m_bIgnoredByEveryone || wanted->m_bIgnoredByCops) {
|
if (wanted->m_bIgnoredByEveryone || wanted->m_bIgnoredByCops) {
|
||||||
|
|
|
@ -832,7 +832,7 @@ CPed::ProcessObjective(void)
|
||||||
m_pMyVehicle->SetStatus(STATUS_PHYSICS);
|
m_pMyVehicle->SetStatus(STATUS_PHYSICS);
|
||||||
m_pMyVehicle->AutoPilot.m_nPrevRouteNode = 0;
|
m_pMyVehicle->AutoPilot.m_nPrevRouteNode = 0;
|
||||||
if (m_nPedType == PEDTYPE_COP) {
|
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();
|
m_pMyVehicle->AutoPilot.m_nCarMission = CCarAI::FindPoliceCarMissionForWantedLevel();
|
||||||
} else {
|
} else {
|
||||||
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = GAME_SPEED_TO_CARAI_SPEED * m_pMyVehicle->pHandling->Transmission.fMaxCruiseVelocity * 0.8f;
|
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = GAME_SPEED_TO_CARAI_SPEED * m_pMyVehicle->pHandling->Transmission.fMaxCruiseVelocity * 0.8f;
|
||||||
|
|
|
@ -582,7 +582,7 @@ CPopulation::AddToPopulation(float minDist, float maxDist, float minDistOffScree
|
||||||
CVector playerCentreOfWorld = FindPlayerCentreOfWorld(CWorld::PlayerInFocus);
|
CVector playerCentreOfWorld = FindPlayerCentreOfWorld(CWorld::PlayerInFocus);
|
||||||
CTheZones::GetZoneInfoForTimeOfDay(&playerCentreOfWorld, &zoneInfo);
|
CTheZones::GetZoneInfoForTimeOfDay(&playerCentreOfWorld, &zoneInfo);
|
||||||
CWanted *wantedInfo = playerInfo->m_pPed->m_pWanted;
|
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
|
if (ms_nNumCop < wantedInfo->m_MaxCops && !playerInfo->m_pPed->bInVehicle
|
||||||
&& (CCarCtrl::NumLawEnforcerCars >= wantedInfo->m_MaximumLawEnforcerVehicles
|
&& (CCarCtrl::NumLawEnforcerCars >= wantedInfo->m_MaximumLawEnforcerVehicles
|
||||||
|| CCarCtrl::NumRandomCars >= playerInfo->m_nTrafficMultiplier * CCarCtrl::CarDensityMultiplier
|
|| CCarCtrl::NumRandomCars >= playerInfo->m_nTrafficMultiplier * CCarCtrl::CarDensityMultiplier
|
||||||
|
|
|
@ -655,7 +655,7 @@ void CHud::Draw()
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
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);
|
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
|
&& (CTimer::GetTimeInMilliseconds() > FindPlayerPed()->m_pWanted->m_nLastWantedLevelChange
|
||||||
+ 2000 || CTimer::GetFrameCounter() & 4)) {
|
+ 2000 || CTimer::GetFrameCounter() & 4)) {
|
||||||
|
|
||||||
|
|
|
@ -240,7 +240,7 @@ CAutomobile::ProcessControl(void)
|
||||||
// Improve grip of vehicles in certain cases
|
// Improve grip of vehicles in certain cases
|
||||||
bool strongGrip1 = false;
|
bool strongGrip1 = false;
|
||||||
bool strongGrip2 = 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_RAMPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_RAMPLAYER_CLOSE ||
|
||||||
AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_CLOSE) &&
|
AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_CLOSE) &&
|
||||||
FindPlayerSpeed().Magnitude() > 0.3f){
|
FindPlayerSpeed().Magnitude() > 0.3f){
|
||||||
|
|
|
@ -474,7 +474,7 @@ CHeli::ProcessControl(void)
|
||||||
// Shoot
|
// Shoot
|
||||||
int shootTimeout;
|
int shootTimeout;
|
||||||
if (m_heliType == HELI_TYPE_RANDOM) {
|
if (m_heliType == HELI_TYPE_RANDOM) {
|
||||||
switch (FindPlayerPed()->m_pWanted->m_nWantedLevel) {
|
switch (FindPlayerPed()->m_pWanted->GetWantedLevel()) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
case 2: shootTimeout = 999999; break;
|
case 2: shootTimeout = 999999; break;
|
||||||
|
|
Loading…
Reference in a new issue