diff options
author | aap <aap@papnet.eu> | 2020-06-25 15:15:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 15:15:01 +0200 |
commit | 592a6aef0bb336f1364e6bf38230f3793ec35c4d (patch) | |
tree | 3b8df6abb470acc7b9b55d0e8476e1478ba626c0 /src | |
parent | rename attractor flag to type (diff) | |
parent | CWanted, anim fix, ped objs renaming, remove III beta features (diff) | |
download | re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar.gz re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar.bz2 re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar.lz re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar.xz re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar.zst re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/animation/AnimBlendHierarchy.cpp | 4 | ||||
-rw-r--r-- | src/animation/AnimBlendNode.cpp | 4 | ||||
-rw-r--r-- | src/animation/AnimManager.cpp | 5 | ||||
-rw-r--r-- | src/control/CarAI.cpp | 8 | ||||
-rw-r--r-- | src/control/CarCtrl.cpp | 4 | ||||
-rw-r--r-- | src/control/GameLogic.cpp | 2 | ||||
-rw-r--r-- | src/control/Garages.cpp | 2 | ||||
-rw-r--r-- | src/control/Phones.cpp | 18 | ||||
-rw-r--r-- | src/control/Phones.h | 7 | ||||
-rw-r--r-- | src/control/SceneEdit.cpp | 8 | ||||
-rw-r--r-- | src/control/Script.cpp | 28 | ||||
-rw-r--r-- | src/core/Cam.cpp | 2 | ||||
-rw-r--r-- | src/core/Crime.h | 3 | ||||
-rw-r--r-- | src/core/EventList.cpp | 17 | ||||
-rw-r--r-- | src/core/Pad.cpp | 4 | ||||
-rw-r--r-- | src/core/PlayerInfo.cpp | 2 | ||||
-rw-r--r-- | src/core/Wanted.cpp | 100 | ||||
-rw-r--r-- | src/core/Wanted.h | 4 | ||||
-rw-r--r-- | src/core/config.h | 1 | ||||
-rw-r--r-- | src/peds/CivilianPed.cpp | 45 | ||||
-rw-r--r-- | src/peds/EmergencyPed.cpp | 4 | ||||
-rw-r--r-- | src/peds/Ped.cpp | 371 | ||||
-rw-r--r-- | src/peds/Ped.h | 62 | ||||
-rw-r--r-- | src/peds/PedAttractor.cpp | 12 | ||||
-rw-r--r-- | src/peds/PlayerPed.cpp | 2 | ||||
-rw-r--r-- | src/render/Hud.cpp | 6 | ||||
-rw-r--r-- | src/vehicles/Automobile.cpp | 8 | ||||
-rw-r--r-- | src/vehicles/Vehicle.cpp | 10 | ||||
-rw-r--r-- | src/weapons/Weapon.cpp | 8 |
29 files changed, 358 insertions, 393 deletions
diff --git a/src/animation/AnimBlendHierarchy.cpp b/src/animation/AnimBlendHierarchy.cpp index 7388352f..d3d6287a 100644 --- a/src/animation/AnimBlendHierarchy.cpp +++ b/src/animation/AnimBlendHierarchy.cpp @@ -44,7 +44,7 @@ CAnimBlendHierarchy::CalcTotalTime(void) #endif totalLength = Max(totalLength, sequences[i].GetKeyFrame(sequences[i].numFrames-1)->deltaTime); - for(j = sequences[i].numFrames-1; j > 0; j--){ + for(j = sequences[i].numFrames-1; j >= 1; j--){ KeyFrame *kf1 = sequences[i].GetKeyFrame(j); KeyFrame *kf2 = sequences[i].GetKeyFrame(j-1); kf1->deltaTime -= kf2->deltaTime; @@ -66,7 +66,7 @@ CAnimBlendHierarchy::CalcTotalTimeCompressed(void) #endif totalLength = Max(totalLength, sequences[i].GetKeyFrameCompressed(sequences[i].numFrames-1)->deltaTime/60.0f); - for(j = sequences[i].numFrames-1; j > 0; j--){ + for(j = sequences[i].numFrames-1; j >= 1; j--){ KeyFrame *kf1 = sequences[i].GetKeyFrameCompressed(j); KeyFrame *kf2 = sequences[i].GetKeyFrameCompressed(j-1); kf1->deltaTime -= kf2->deltaTime; diff --git a/src/animation/AnimBlendNode.cpp b/src/animation/AnimBlendNode.cpp index 63665873..c54b5718 100644 --- a/src/animation/AnimBlendNode.cpp +++ b/src/animation/AnimBlendNode.cpp @@ -97,10 +97,8 @@ CAnimBlendNode::FindKeyFrame(float t) if(sequence->numFrames == 1){ remainingTime = 0.0f; }else{ - frameA++; - // advance until t is between frameB and frameA - while(t > sequence->GetKeyFrame(frameA)->deltaTime){ + while(t > sequence->GetKeyFrame(++frameA)->deltaTime){ t -= sequence->GetKeyFrame(frameA)->deltaTime; if(frameA + 1 >= sequence->numFrames){ // reached end of animation diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp index 385f1f67..4694920a 100644 --- a/src/animation/AnimManager.cpp +++ b/src/animation/AnimManager.cpp @@ -1004,9 +1004,10 @@ CAnimManager::UncompressAnimation(CAnimBlendHierarchy *hier) }else{ CLink<CAnimBlendHierarchy*> *link = ms_animCache.Insert(hier); if(link == nil){ - ms_animCache.tail.prev->item->RemoveUncompressedData(); + CAnimBlendHierarchy *lastHier = ms_animCache.tail.prev->item; + lastHier->RemoveUncompressedData(); ms_animCache.Remove(ms_animCache.tail.prev); - ms_animCache.tail.prev->item->linkPtr = nil; + lastHier->linkPtr = nil; link = ms_animCache.Insert(hier); } hier->linkPtr = link; diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp index a5002ec5..7e517a83 100644 --- a/src/control/CarAI.cpp +++ b/src/control/CarAI.cpp @@ -585,7 +585,7 @@ void CCarAI::AddFiretruckOccupants(CVehicle* pVehicle) void CCarAI::TellOccupantsToLeaveCar(CVehicle* pVehicle) { if (pVehicle->pDriver){ - pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle); + pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle); if (pVehicle->GetModelIndex() == MI_AMBULAN) pVehicle->pDriver->Say(SOUND_PED_LEAVE_VEHICLE); } @@ -593,7 +593,7 @@ void CCarAI::TellOccupantsToLeaveCar(CVehicle* pVehicle) for (int i = 0; i < pVehicle->m_nNumMaxPassengers; i++){ if (pVehicle->pPassengers[i]) { pVehicle->pPassengers[i]->m_leaveCarTimer = timer; - pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle); + pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle); timer += CGeneral::GetRandomNumberInRange(200, 400); } } @@ -602,7 +602,7 @@ void CCarAI::TellOccupantsToLeaveCar(CVehicle* pVehicle) void CCarAI::TellOccupantsToFleeCar(CVehicle* pVehicle) { if (pVehicle->pDriver && !pVehicle->pDriver->IsPlayer()) { - pVehicle->pDriver->SetObjective(OBJECTIVE_FLEE_TILL_SAFE); + pVehicle->pDriver->SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE); if (pVehicle->GetModelIndex() != MI_FIRETRUCK && pVehicle->GetModelIndex() == MI_AMBULAN) pVehicle->pDriver->Say(SOUND_PED_LEAVE_VEHICLE); } @@ -610,7 +610,7 @@ void CCarAI::TellOccupantsToFleeCar(CVehicle* pVehicle) for (int i = 0; i < pVehicle->m_nNumMaxPassengers; i++) { if (pVehicle->pPassengers[i]) { pVehicle->pPassengers[i]->m_leaveCarTimer = timer; - pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_FLEE_TILL_SAFE); + pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE); timer += CGeneral::GetRandomNumberInRange(200, 400); } } diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 3b19a5b0..514150a6 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -701,7 +701,7 @@ CCarCtrl::GenerateOneRandomCar() pVehicle->SetMoveSpeed(0.0f, 0.0f, 0.0f); for (int i = 0; i < pVehicle->m_nNumPassengers; i++) { if (pVehicle->pPassengers[i]) { - pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle); + pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle); pVehicle->pPassengers[i]->m_nLastPedState = PED_WANDER_PATH; pVehicle->pPassengers[i]->m_vehicleInAccident = pVehicle; pVehicle->pPassengers[i]->bDeadPedInFrontOfCar = true; @@ -709,7 +709,7 @@ CCarCtrl::GenerateOneRandomCar() } } if (pVehicle->pDriver) { - pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle); + pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle); pVehicle->pDriver->m_nLastPedState = PED_WANDER_PATH; pVehicle->pDriver->m_vehicleInAccident = pVehicle; pVehicle->pDriver->bDeadPedInFrontOfCar = true; diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp index 50e5584d..61b8a0e0 100644 --- a/src/control/GameLogic.cpp +++ b/src/control/GameLogic.cpp @@ -503,7 +503,7 @@ CGameLogic::UpdateShortCut() case SHORTCUT_ARRIVING: if (CTimer::GetTimeInMilliseconds() > ShortCutTimer) { CWorld::Players[CWorld::PlayerInFocus].m_nMoney = Max(0, CWorld::Players[CWorld::PlayerInFocus].m_nMoney - SHORTCUT_TAXI_COST); - FindPlayerPed()->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pShortCutTaxi); + FindPlayerPed()->SetObjective(OBJECTIVE_LEAVE_CAR, pShortCutTaxi); FindPlayerPed()->m_carInObjective = pShortCutTaxi; ShortCutState = SHORTCUT_GETTING_OUT; } diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index f0b924e6..88654141 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -1100,7 +1100,7 @@ bool CGarage::IsStaticPlayerCarEntirelyInside() return false; if (FindPlayerPed()->GetPedState() != PED_DRIVING) return false; - if (FindPlayerPed()->m_objective == OBJECTIVE_LEAVE_VEHICLE) + if (FindPlayerPed()->m_objective == OBJECTIVE_LEAVE_CAR) return false; CVehicle* pVehicle = FindPlayerVehicle(); if (pVehicle->GetPosition().x < m_fInfX || pVehicle->GetPosition().x > m_fSupX || diff --git a/src/control/Phones.cpp b/src/control/Phones.cpp index 6fac3f9d..c0b50119 100644 --- a/src/control/Phones.cpp +++ b/src/control/Phones.cpp @@ -34,18 +34,6 @@ CPed *CPhoneInfo::pCallBackPed; // ped who picking up the phone (reset after pic after 60 seconds of last phone pick-up. */ -#ifdef TOGGLEABLE_BETA_FEATURES -CPed* crimeReporters[NUMPHONES] = {}; -bool -isPhoneAvailable(int m_phoneId) -{ - return gPhoneInfo.m_aPhones[m_phoneId].m_nState == PHONE_STATE_FREE && - (crimeReporters[m_phoneId] == nil || !crimeReporters[m_phoneId]->IsPointerValid() || !crimeReporters[m_phoneId]->bRunningToPhone || crimeReporters[m_phoneId]->m_objective > OBJECTIVE_IDLE || - crimeReporters[m_phoneId]->m_nLastPedState != PED_SEEK_POS && - (crimeReporters[m_phoneId]->m_nPedState != PED_MAKE_CALL && crimeReporters[m_phoneId]->m_nPedState != PED_FACE_PHONE && crimeReporters[m_phoneId]->m_nPedState != PED_SEEK_POS)); -} -#endif - void CPhoneInfo::Update(void) { @@ -164,11 +152,7 @@ CPhoneInfo::FindNearestFreePhone(CVector *pos) for (int phoneId = 0; phoneId < m_nMax; phoneId++) { - if (gPhoneInfo.m_aPhones[phoneId].m_nState == PHONE_STATE_FREE -#ifdef TOGGLEABLE_BETA_FEATURES - && isPhoneAvailable(phoneId) -#endif - ) { + if (gPhoneInfo.m_aPhones[phoneId].m_nState == PHONE_STATE_FREE) { float phoneDist = (m_aPhones[phoneId].m_vecPos - *pos).Magnitude2D(); if (phoneDist < nearestPhoneDist) { diff --git a/src/control/Phones.h b/src/control/Phones.h index 14d47ed1..81b40dc2 100644 --- a/src/control/Phones.h +++ b/src/control/Phones.h @@ -66,9 +66,4 @@ public: extern CPhoneInfo gPhoneInfo; void PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg); -void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg); - -#ifdef TOGGLEABLE_BETA_FEATURES -extern CPed *crimeReporters[NUMPHONES]; -bool isPhoneAvailable(int); -#endif
\ No newline at end of file +void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg);
\ No newline at end of file diff --git a/src/control/SceneEdit.cpp b/src/control/SceneEdit.cpp index 535f6bec..a7727fde 100644 --- a/src/control/SceneEdit.cpp +++ b/src/control/SceneEdit.cpp @@ -631,7 +631,7 @@ void CSceneEdit::ProcessCommand(void) SelectActor(); if (m_bActorSelected) { if (pActors[m_nActor]->bInVehicle) { - pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_VEHICLE); + pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_CAR); Movie[m_nNumMovieCommands].m_nCommandId = MOVIE_GET_OUT_CAR; Movie[m_nNumMovieCommands++].m_nActorId = m_nActor; } @@ -695,7 +695,7 @@ void CSceneEdit::ProcessCommand(void) case MOVIE_WAIT: SelectActor(); if (m_bActorSelected) { - pActors[m_nActor]->SetObjective(OBJECTIVE_IDLE); + pActors[m_nActor]->SetObjective(OBJECTIVE_WAIT_ON_FOOT); Movie[m_nNumMovieCommands].m_nCommandId = MOVIE_WAIT; Movie[m_nNumMovieCommands++].m_nActorId = m_nActor; } @@ -876,7 +876,7 @@ void CSceneEdit::PlayBack(void) case MOVIE_GET_OUT_CAR: m_nActor = Movie[m_nCurrentMovieCommand].m_nActorId; if (pActors[m_nActor]->bInVehicle) - pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_VEHICLE); + pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_CAR); else ++m_nCurrentMovieCommand; break; @@ -895,7 +895,7 @@ void CSceneEdit::PlayBack(void) break; case MOVIE_WAIT: m_nActor = Movie[m_nCurrentMovieCommand].m_nActorId; - pActors[m_nActor]->SetObjective(OBJECTIVE_IDLE); + pActors[m_nActor]->SetObjective(OBJECTIVE_WAIT_ON_FOOT); ++m_nCurrentMovieCommand; break; case MOVIE_POSITION_CAMERA: diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 8635a548..74dfaac6 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -1530,7 +1530,7 @@ int8 CRunningScript::ProcessCommands0To99(int32 command) CPed* pTestedPed = ped->m_nearPeds[i]; if (!pTestedPed || !IsPedPointerValid(pTestedPed)) continue; - if (pTestedPed->m_pedInObjective == ped && pTestedPed->m_objective == OBJECTIVE_FOLLOW_PED_IN_FORMATION) { + if (pTestedPed->m_pedInObjective == ped && pTestedPed->m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION) { CVector vFollowerPos = pTestedPed->GetFormationPosition(); CTheScripts::ClearSpaceForMissionEntity(vFollowerPos, ped); bool bFound = false; @@ -2070,7 +2070,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command) CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(ped); ped->bScriptObjectiveCompleted = false; - ped->SetObjective(OBJECTIVE_IDLE); + ped->SetObjective(OBJECTIVE_WAIT_ON_FOOT); return 0; } case COMMAND_GET_CHAR_COORDINATES: @@ -3840,7 +3840,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(pPed); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_IDLE); + pPed->SetObjective(OBJECTIVE_WAIT_ON_FOOT); return 0; } case COMMAND_SET_CHAR_OBJ_FLEE_ON_FOOT_TILL_SAFE: @@ -4321,7 +4321,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) assert(pPed); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle); + pPed->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle); return 0; } case COMMAND_SET_CHAR_OBJ_ENTER_CAR_AS_PASSENGER: @@ -4353,7 +4353,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) assert(pPed); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_DESTROY_OBJ, pVehicle); + pPed->SetObjective(OBJECTIVE_DESTROY_OBJECT, pVehicle); return 0; } case COMMAND_SET_CHAR_OBJ_DESTROY_CAR: @@ -6568,7 +6568,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command) assert(pPed); CPed* pTargetPed = CPools::GetPedPool()->GetAt(ScriptParams[1]); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_FOLLOW_PED_IN_FORMATION, pTargetPed); + pPed->SetObjective(OBJECTIVE_FOLLOW_CHAR_IN_FORMATION, pTargetPed); pPed->SetFormation((eFormation)ScriptParams[2]); return 0; } @@ -8804,7 +8804,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command) CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(pPed); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pPed->m_pMyVehicle); + pPed->SetObjective(OBJECTIVE_LEAVE_CAR, pPed->m_pMyVehicle); return 0; } case COMMAND_SET_SPRITES_DRAW_BEFORE_FADE: @@ -9537,7 +9537,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed; assert(pPed); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]); - UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_VEHICLE && pPed->m_pMyVehicle == pVehicle); + UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_CAR && pPed->m_pMyVehicle == pVehicle); return 0; } case COMMAND_IS_PLAYER_SITTING_IN_ANY_CAR: @@ -9545,7 +9545,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) CollectParameters(&m_nIp, 1); CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed; assert(pPed); - UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_VEHICLE); + UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_CAR); return 0; } /* @@ -9582,7 +9582,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) assert(pPed); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]); assert(pVehicle); - UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_VEHICLE && pPed->m_pMyVehicle == pVehicle); + UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_CAR && pPed->m_pMyVehicle == pVehicle); return 0; } case COMMAND_IS_CHAR_SITTING_IN_ANY_CAR: @@ -9590,7 +9590,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) CollectParameters(&m_nIp, 1); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(pPed); - UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_VEHICLE); + UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_CAR); return 0; } case COMMAND_IS_PLAYER_ON_FOOT: @@ -10718,7 +10718,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) CPed* pTargetPed = CPools::GetPedPool()->GetAt(ScriptParams[1]); assert(pTargetPed); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_AIM_GUN_AT_PED, pTargetPed); + pPed->SetObjective(OBJECTIVE_AIM_GUN_AT, pTargetPed); return 0; } case COMMAND_SWITCH_SECURITY_CAMERA: @@ -11134,7 +11134,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) pos.y = *(float*)&ScriptParams[2]; pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_SPRINT_TO_COORD, pos); + pPed->SetObjective(OBJECTIVE_SPRINT_TO_AREA, pos); return 0; } case COMMAND_CREATE_SWAT_ROPE: @@ -14239,7 +14239,7 @@ void CTheScripts::CleanUpThisPed(CPed* pPed) } else { if (pPed->m_pMyVehicle->m_vehType == VEHICLE_TYPE_CAR) { - pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pPed->m_pMyVehicle); + pPed->SetObjective(OBJECTIVE_LEAVE_CAR, pPed->m_pMyVehicle); pPed->bWanderPathAfterExitingCar = true; } } diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index b01572e9..6f1ad310 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -5071,7 +5071,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation, // This is not working on cars as SA // Because III/VC doesn't have any buttons tied to LeftStick if you're not in Classic Configuration, using Dodo or using GInput/Pad, so :shrug: if (Abs(pad->GetSteeringUpDown()) > 120.0f) { - if (car->pDriver && car->pDriver->m_objective != OBJECTIVE_LEAVE_VEHICLE) { + if (car->pDriver && car->pDriver->m_objective != OBJECTIVE_LEAVE_CAR) { yMovement += Abs(pad->GetSteeringUpDown()) * (FOV / 80.0f * 3.f / 70.f) * pad->GetSteeringUpDown() * 0.007f * 0.007f * 0.5; } } diff --git a/src/core/Crime.h b/src/core/Crime.h index 8dfae5b8..3c3e2b26 100644 --- a/src/core/Crime.h +++ b/src/core/Crime.h @@ -18,6 +18,9 @@ enum eCrimeType { CRIME_COP_BURNED, CRIME_VEHICLE_BURNED, CRIME_DESTROYED_CESSNA, + CRIME_EXPLOSION, + CRIME_HIT_PED_NASTYWEAPON, + CRIME_HIT_COP_NASTYWEAPON, NUM_CRIME_TYPES }; diff --git a/src/core/EventList.cpp b/src/core/EventList.cpp index c3508a51..4fab29bc 100644 --- a/src/core/EventList.cpp +++ b/src/core/EventList.cpp @@ -187,6 +187,7 @@ CEventList::FindClosestEvent(eEventType type, CVector posn, int32 *event) return found; } +// --MIAMI: Done void CEventList::ReportCrimeForEvent(eEventType type, int32 crimeId, bool copsDontCare) { @@ -201,19 +202,31 @@ CEventList::ReportCrimeForEvent(eEventType type, int32 crimeId, bool copsDontCar case EVENT_HIT_AND_RUN_COP: crime = CRIME_RUNOVER_COP; break; case EVENT_SHOOT_PED: crime = CRIME_SHOOT_PED; break; case EVENT_SHOOT_COP: crime = CRIME_SHOOT_COP; break; + case EVENT_EXPLOSION: crime = CRIME_EXPLOSION; break; case EVENT_PED_SET_ON_FIRE: crime = CRIME_PED_BURNED; break; case EVENT_COP_SET_ON_FIRE: crime = CRIME_COP_BURNED; break; case EVENT_CAR_SET_ON_FIRE: crime = CRIME_VEHICLE_BURNED; break; + case EVENT_ASSAULT_NASTYWEAPON: crime = CRIME_HIT_PED_NASTYWEAPON; break; + case EVENT_ASSAULT_NASTYWEAPON_POLICE: crime = CRIME_HIT_COP_NASTYWEAPON; break; default: crime = CRIME_NONE; break; } + if (crime == CRIME_HIT_PED && IsPedPointerValid((CPed*)crimeId) && FindPlayerPed()->m_pWanted->m_nWantedLevel == 0 && ((CPed*)crimeId)->bBeingChasedByPolice) { + if (!((CPed*)crimeId)->DyingOrDead()) { + CMessages::AddBigMessage(TheText.Get("GOODBOY"), 5000, 0); + CWorld::Players[CWorld::PlayerInFocus].m_nMoney += 50; + } + return; + } + if(crime == CRIME_NONE) return; CVector playerPedCoors = FindPlayerPed()->GetPosition(); CVector playerCoors = FindPlayerCoors(); - if(CWanted::WorkOutPolicePresence(playerCoors, 14.0f) != 0){ + if(CWanted::WorkOutPolicePresence(playerCoors, 14.0f) != 0 || + CGame::germanGame && (crime == CRIME_SHOOT_PED || crime == CRIME_SHOOT_COP || crime == CRIME_COP_BURNED || crime == CRIME_VEHICLE_BURNED)){ FindPlayerPed()->m_pWanted->RegisterCrime_Immediately(crime, playerPedCoors, crimeId, copsDontCare); FindPlayerPed()->m_pWanted->SetWantedLevelNoDrop(1); }else @@ -221,7 +234,7 @@ CEventList::ReportCrimeForEvent(eEventType type, int32 crimeId, bool copsDontCar if(type == EVENT_ASSAULT_POLICE) FindPlayerPed()->SetWantedLevelNoDrop(1); - if(type == EVENT_SHOOT_COP) + if(type == EVENT_SHOOT_COP || type == EVENT_ASSAULT_NASTYWEAPON_POLICE) FindPlayerPed()->SetWantedLevelNoDrop(2); } diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 56bc1431..56c05c71 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -315,13 +315,13 @@ void ArmourCheat() void WantedLevelUpCheat() { CHud::SetHelpMessage(TheText.Get("CHEAT5"), true); - FindPlayerPed()->SetWantedLevel(Min(FindPlayerPed()->m_pWanted->m_nWantedLevel + 2, 6)); + FindPlayerPed()->m_pWanted->CheatWantedLevel(Min(FindPlayerPed()->m_pWanted->m_nWantedLevel + 2, 6)); } void WantedLevelDownCheat() { CHud::SetHelpMessage(TheText.Get("CHEAT5"), true); - FindPlayerPed()->SetWantedLevel(0); + FindPlayerPed()->m_pWanted->CheatWantedLevel(0); } void SunnyWeatherCheat() diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp index ed2690eb..cc6b1304 100644 --- a/src/core/PlayerInfo.cpp +++ b/src/core/PlayerInfo.cpp @@ -416,7 +416,7 @@ CPlayerInfo::Process(void) if (veh->m_vehType != VEHICLE_TYPE_BIKE || veh->m_nDoorLock == CARLOCK_LOCKED_PLAYER_INSIDE) { if (veh->GetStatus() != STATUS_WRECKED && veh->GetStatus() != STATUS_TRAIN_MOVING && veh->m_nDoorLock != CARLOCK_LOCKED_PLAYER_INSIDE) { if (veh->m_vecMoveSpeed.Magnitude() < 0.17f && CTimer::GetTimeScale() >= 0.5f && !veh->bIsInWater) { - m_pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh); + m_pPed->SetObjective(OBJECTIVE_LEAVE_CAR, veh); } } } else { diff --git a/src/core/Wanted.cpp b/src/core/Wanted.cpp index d2623431..83407c56 100644 --- a/src/core/Wanted.cpp +++ b/src/core/Wanted.cpp @@ -12,14 +12,18 @@ #include "General.h" int32 CWanted::MaximumWantedLevel = 6; -int32 CWanted::nMaximumWantedLevel = 6400; +int32 CWanted::nMaximumWantedLevel = 9600; + +// --MIAMI: File done except stats void CWanted::Initialise() { m_nChaos = 0; + m_nMinChaos = 0; m_nLastUpdateTime = 0; m_nLastWantedLevelChange = 0; + m_nLastTimeSuspended = 0; m_CurrentCops = 0; m_MaxCops = 0; m_MaximumLawEnforcerVehicles = 0; @@ -31,6 +35,7 @@ CWanted::Initialise() m_bArmyRequired = false; m_fCrimeSensitivity = 1.0f; m_nWantedLevel = 0; + m_nMinWantedLevel = 0; m_CopsBeatingSuspect = 0; for (int i = 0; i < ARRAY_SIZE(m_pCops); i++) @@ -75,7 +80,7 @@ CWanted::NumOfHelisRequired() return 1; case 5: case 6: - return 2; + return 1; default: return 0; } @@ -93,22 +98,22 @@ CWanted::SetWantedLevel(int32 level) m_nChaos = 0; break; case 1: - m_nChaos = 60; + m_nChaos = 70; break; case 2: - m_nChaos = 220; + m_nChaos = 200; break; case 3: - m_nChaos = 420; + m_nChaos = 570; break; case 4: - m_nChaos = 820; + m_nChaos = 1220; break; case 5: - m_nChaos = 1620; + m_nChaos = 2420; break; case 6: - m_nChaos = 3220; + m_nChaos = 4820; break; default: break; @@ -119,11 +124,21 @@ CWanted::SetWantedLevel(int32 level) void CWanted::SetWantedLevelNoDrop(int32 level) { + if (m_nWantedLevel < m_nMinWantedLevel) + SetWantedLevel(m_nMinWantedLevel); + if (level > m_nWantedLevel) SetWantedLevel(level); } void +CWanted::CheatWantedLevel(int32 level) +{ + SetWantedLevel(level); + UpdateWantedLevel(); +} + +void CWanted::SetMaximumWantedLevel(int32 level) { switch(level){ @@ -132,27 +147,27 @@ CWanted::SetMaximumWantedLevel(int32 level) MaximumWantedLevel = 0; break; case 1: - nMaximumWantedLevel = 120; + nMaximumWantedLevel = 115; MaximumWantedLevel = 1; break; case 2: - nMaximumWantedLevel = 300; + nMaximumWantedLevel = 365; MaximumWantedLevel = 2; break; case 3: - nMaximumWantedLevel = 600; + nMaximumWantedLevel = 875; MaximumWantedLevel = 3; break; case 4: - nMaximumWantedLevel = 1200; + nMaximumWantedLevel = 1800; MaximumWantedLevel = 4; break; case 5: - nMaximumWantedLevel = 2400; + nMaximumWantedLevel = 3600; MaximumWantedLevel = 5; break; case 6: - nMaximumWantedLevel = 4800; + nMaximumWantedLevel = 7200; MaximumWantedLevel = 6; break; } @@ -167,7 +182,11 @@ CWanted::RegisterCrime(eCrimeType type, const CVector &coors, uint32 id, bool po void CWanted::RegisterCrime_Immediately(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare) { +#ifdef FIX_BUGS + if(!AddCrimeToQ(type, id, coors, true, policeDoesntCare)) +#else if(!AddCrimeToQ(type, id, coors, false, policeDoesntCare)) +#endif ReportCrimeNow(type, coors, policeDoesntCare); } @@ -271,14 +290,25 @@ CWanted::ReportCrimeNow(eCrimeType type, const CVector &coors, bool policeDoesnt case CRIME_DESTROYED_CESSNA: m_nChaos += 500.0f*chaos; break; + case CRIME_EXPLOSION: + m_nChaos += 25.0f * chaos; + break; + case CRIME_HIT_PED_NASTYWEAPON: + m_nChaos += 35.0f * chaos; + break; + case CRIME_HIT_COP_NASTYWEAPON: + m_nChaos += 100.0f * chaos; + break; default: // Error("Undefined crime type, RegisterCrime, Crime.cpp"); // different file for some reason Error("Undefined crime type, RegisterCrime, Wanted.cpp"); } + m_nChaos = Max(m_nChaos, m_nMinChaos); DMAudio.ReportCrime(type, coors); UpdateWantedLevel(); } +// TODO(Miami): Stats void CWanted::UpdateWantedLevel() { @@ -287,47 +317,41 @@ CWanted::UpdateWantedLevel() if (m_nChaos > nMaximumWantedLevel) m_nChaos = nMaximumWantedLevel; - if (m_nChaos >= 0 && m_nChaos < 40) { + if (m_nChaos >= 0 && m_nChaos < 50) { m_nWantedLevel = 0; m_MaximumLawEnforcerVehicles = 0; m_MaxCops = 0; m_RoadblockDensity = 0; - } - else if (m_nChaos >= 40 && m_nChaos < 200) { + } else if (m_nChaos >= 50 && m_nChaos < 180) { m_nWantedLevel = 1; m_MaximumLawEnforcerVehicles = 1; m_MaxCops = 1; m_RoadblockDensity = 0; - } - else if (m_nChaos >= 200 && m_nChaos < 400) { + } else if (m_nChaos >= 180 && m_nChaos < 550) { m_nWantedLevel = 2; m_MaximumLawEnforcerVehicles = 2; m_MaxCops = 3; m_RoadblockDensity = 0; - } - else if (m_nChaos >= 400 && m_nChaos < 800) { + } else if (m_nChaos >= 550 && m_nChaos < 1200) { m_nWantedLevel = 3; m_MaximumLawEnforcerVehicles = 2; m_MaxCops = 4; - m_RoadblockDensity = 4; - } - else if (m_nChaos >= 800 && m_nChaos < 1600) { + m_RoadblockDensity = 12; + } else if (m_nChaos >= 1200 && m_nChaos < 2400) { m_nWantedLevel = 4; m_MaximumLawEnforcerVehicles = 2; m_MaxCops = 6; - m_RoadblockDensity = 8; - } - else if (m_nChaos >= 1600 && m_nChaos < 3200) { + m_RoadblockDensity = 18; + } else if (m_nChaos >= 2400 && m_nChaos < 4800) { m_nWantedLevel = 5; m_MaximumLawEnforcerVehicles = 3; m_MaxCops = 8; - m_RoadblockDensity = 10; - } - else if (m_nChaos >= 3200) { + m_RoadblockDensity = 24; + } else if (m_nChaos >= 4800) { m_nWantedLevel = 6; m_MaximumLawEnforcerVehicles = 3; m_MaxCops = 10; - m_RoadblockDensity = 12; + m_RoadblockDensity = 30; } if (CurrWantedLevel != m_nWantedLevel) @@ -369,6 +393,10 @@ CWanted::WorkOutPolicePresence(CVector posn, float radius) void CWanted::Update(void) { + if (CTimer::GetTimeInMilliseconds() > m_nLastTimeSuspended + 20000) { + m_nMinChaos = 0; + m_nMinWantedLevel = 0; + } if (CTimer::GetTimeInMilliseconds() - m_nLastUpdateTime > 1000) { if (m_nWantedLevel > 1) { m_nLastUpdateTime = CTimer::GetTimeInMilliseconds(); @@ -466,6 +494,12 @@ CWanted::UpdateCrimesQ(void) void CWanted::Suspend(void) { - // TODO(MIAMI)! - Reset(); // <- temporary + // TODO(Miami): Stats + // dwStarsEvaded += m_nWantedLevel; + m_nMinChaos = m_nChaos; + m_nMinWantedLevel = m_nWantedLevel; + m_nLastTimeSuspended = CTimer::GetTimeInMilliseconds(); + m_nChaos = 0; + m_nWantedLevel = 0; + ResetPolicePursuit(); } diff --git a/src/core/Wanted.h b/src/core/Wanted.h index ee72aa47..057b5407 100644 --- a/src/core/Wanted.h +++ b/src/core/Wanted.h @@ -9,8 +9,10 @@ class CWanted { public: int32 m_nChaos; + int32 m_nMinChaos; int32 m_nLastUpdateTime; uint32 m_nLastWantedLevelChange; + uint32 m_nLastTimeSuspended; float m_fCrimeSensitivity; uint8 m_CurrentCops; uint8 m_MaxCops; @@ -23,6 +25,7 @@ public: uint8 m_bFbiRequired : 1; uint8 m_bArmyRequired : 1; int32 m_nWantedLevel; + int32 m_nMinWantedLevel; CCrimeBeingQd m_aCrimes[16]; CCopPed *m_pCops[10]; @@ -38,6 +41,7 @@ public: int32 NumOfHelisRequired(); void SetWantedLevel(int32); void SetWantedLevelNoDrop(int32 level); + void CheatWantedLevel(int32 level); 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/core/config.h b/src/core/config.h index ad5c0064..ba51fb19 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -204,7 +204,6 @@ enum Config { // Just debug menu entries #ifdef DEBUGMENU -#define TOGGLEABLE_BETA_FEATURES // not too many things #define RELOADABLES // some debug menu options to reload TXD files #define MISSION_SWITCHER // from debug menu #endif diff --git a/src/peds/CivilianPed.cpp b/src/peds/CivilianPed.cpp index dd438a3f..cec45e1b 100644 --- a/src/peds/CivilianPed.cpp +++ b/src/peds/CivilianPed.cpp @@ -118,31 +118,12 @@ CCivilianPed::CivilianAI(void) investigateDeadPed = false; } -#ifdef TOGGLEABLE_BETA_FEATURES - eCrimeType crime = (((CPed*)m_pEventEntity)->m_ped_flagI40 ? - (((CPed*)m_pEventEntity)->m_nPedType == PEDTYPE_COP ? CRIME_RUNOVER_COP : CRIME_RUNOVER_PED) : - (((CPed*)m_pEventEntity)->m_nPedType == PEDTYPE_COP ? CRIME_SHOOT_COP : CRIME_SHOOT_PED)); - bool eligibleToReport = bMakePedsRunToPhonesToReportCrimes && killerOfDeadPed && killerOfDeadPed->IsPed() && ((CPed*)killerOfDeadPed)->IsPlayer() && - m_pedStats->m_fear <= m_pedStats->m_lawfulness && m_pedStats->m_temper <= m_pedStats->m_fear; - if (IsGangMember() || !eligibleToReport || !RunToReportCrime(crime)) -#endif if (investigateDeadPed) SetInvestigateEvent(EVENT_DEAD_PED, CVector2D(m_pEventEntity->GetPosition()), 1.0f, 20000, 0.0f); } else { -#ifdef TOGGLEABLE_BETA_FEATURES - CEntity* killerOfDeadPed = ((CPed*)m_pEventEntity)->m_threatEntity; - eCrimeType crime = (((CPed*)m_pEventEntity)->m_ped_flagI40 ? - (((CPed*)m_pEventEntity)->m_nPedType == PEDTYPE_COP ? CRIME_RUNOVER_COP : CRIME_RUNOVER_PED) : - (((CPed*)m_pEventEntity)->m_nPedType == PEDTYPE_COP ? CRIME_SHOOT_COP : CRIME_SHOOT_PED)); - bool eligibleToReport = bMakePedsRunToPhonesToReportCrimes && killerOfDeadPed && killerOfDeadPed->IsPed() && ((CPed*)killerOfDeadPed)->IsPlayer() && - m_pedStats->m_fear <= m_pedStats->m_lawfulness && m_pedStats->m_temper <= m_pedStats->m_fear; - if(!eligibleToReport || !RunToReportCrime(crime)) -#endif - { - SetFindPathAndFlee(m_pEventEntity, 5000); - SetMoveState(PEDMOVE_RUN); - } + SetFindPathAndFlee(m_pEventEntity, 5000); + SetMoveState(PEDMOVE_RUN); } } else if (closestThreatFlag == PED_FLAG_EXPLOSION) { CVector2D eventDistVec = m_eventOrThreat - GetPosition(); @@ -219,18 +200,7 @@ CCivilianPed::ProcessControl(void) if (Seek()) { if ((m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT || m_objective == OBJECTIVE_RUN_TO_AREA || IsUseAttractorObjective(m_objective)) && m_pNextPathNode) { m_pNextPathNode = nil; -#ifdef TOGGLEABLE_BETA_FEATURES - } else if (bRunningToPhone && m_objective < OBJECTIVE_FLEE_TILL_SAFE) { - if (!isPhoneAvailable(m_phoneId)) { - RestorePreviousState(); - crimeReporters[m_phoneId] = nil; - m_phoneId = -1; - bRunningToPhone = false; - } else { - crimeReporters[m_phoneId] = this; - m_nPedState = PED_FACE_PHONE; - } -#else + } else if (bRunningToPhone) { if (gPhoneInfo.m_aPhones[m_phoneId].m_nState != PHONE_STATE_FREE) { RestorePreviousState(); @@ -239,9 +209,8 @@ CCivilianPed::ProcessControl(void) gPhoneInfo.m_aPhones[m_phoneId].m_nState = PHONE_STATE_REPORTING_CRIME; m_nPedState = PED_FACE_PHONE; } -#endif } else if (m_objective != OBJECTIVE_KILL_CHAR_ANY_MEANS && m_objective != OBJECTIVE_KILL_CHAR_ON_FOOT) { - if (m_objective == OBJECTIVE_FOLLOW_PED_IN_FORMATION) { + if (m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION) { if (m_moved.Magnitude() == 0.0f) { if (m_pedInObjective->m_nMoveState == PEDMOVE_STILL) m_fRotationDest = m_pedInObjective->m_fRotationCur; @@ -331,13 +300,13 @@ CCivilianPed::ProcessControl(void) } else { bWanderPathAfterExitingCar = true; CWorld::Players[CWorld::PlayerInFocus].m_pHooker = nil; - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } } else { bWanderPathAfterExitingCar = true; CWorld::Players[CWorld::PlayerInFocus].m_pHooker = nil; m_pMyVehicle->pDriver->m_fHealth = CWorld::Players[0].m_nMaxHealth + 25.0f; - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } } else { CWorld::Players[CWorld::PlayerInFocus].m_nNextSexFrequencyUpdateTime = CTimer::GetTimeInMilliseconds() + 3000; @@ -350,7 +319,7 @@ CCivilianPed::ProcessControl(void) } else { bWanderPathAfterExitingCar = true; CWorld::Players[CWorld::PlayerInFocus].m_pHooker = nil; - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } } diff --git a/src/peds/EmergencyPed.cpp b/src/peds/EmergencyPed.cpp index 44c3d066..a33e31f9 100644 --- a/src/peds/EmergencyPed.cpp +++ b/src/peds/EmergencyPed.cpp @@ -185,12 +185,12 @@ CEmergencyPed::MedicAI(void) } if (InVehicle()) { - if (m_pMyVehicle->IsCar() && m_objective != OBJECTIVE_LEAVE_VEHICLE) { + if (m_pMyVehicle->IsCar() && m_objective != OBJECTIVE_LEAVE_CAR) { if (gAccidentManager.FindNearestAccident(m_pMyVehicle->GetPosition(), &distToEmergency) && distToEmergency < 25.0f && m_pMyVehicle->m_vecMoveSpeed.Magnitude() < 0.01f) { m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_NONE; - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); Say(SOUND_PED_LEAVE_VEHICLE); } else if (m_pMyVehicle->pDriver == this && m_nPedState == PED_DRIVING && m_pMyVehicle->AutoPilot.m_nCarMission == MISSION_NONE && !(CGeneral::GetRandomNumber() & 31)) { diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 358dee95..2fe2ce02 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -143,11 +143,6 @@ void *CPed::operator new(size_t sz, int handle) { return CPools::GetPedPool()->N void CPed::operator delete(void *p, size_t sz) { CPools::GetPedPool()->Delete((CPed*)p); } void CPed::operator delete(void *p, int handle) { CPools::GetPedPool()->Delete((CPed*)p); } -#ifdef TOGGLEABLE_BETA_FEATURES -bool CPed::bPopHeadsOnHeadshot = false; -bool CPed::bMakePedsRunToPhonesToReportCrimes = false; -#endif - // --MIAMI: Done CPed::~CPed(void) { @@ -812,11 +807,7 @@ CPed::RemoveBodyPart(PedNode nodeId, int8 direction) if(!IsClumpSkinned(GetClump())) #endif { -#ifdef TOGGLEABLE_BETA_FEATURES - if (bPopHeadsOnHeadshot || nodeId != PED_HEAD) -#else if (nodeId != PED_HEAD) -#endif SpawnFlyingComponent(nodeId, direction); RecurseFrameChildrenVisibilityCB(frame, nil); @@ -2964,7 +2955,7 @@ CPed::CanSeeEntity(CEntity *entity, float threshold = CAN_SEE_ENTITY_ANGLE_THRES bool CPed::IsTemporaryObjective(eObjective objective) { - return objective == OBJECTIVE_LEAVE_VEHICLE || objective == OBJECTIVE_SET_LEADER || + return objective == OBJECTIVE_LEAVE_CAR || objective == OBJECTIVE_SET_LEADER || objective == OBJECTIVE_LEAVE_CAR_AND_DIE || objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER; } @@ -2996,7 +2987,7 @@ CPed::ForceStoredObjective(eObjective objective) } switch (m_objective) { - case OBJECTIVE_FLEE_TILL_SAFE: + case OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE: case OBJECTIVE_KILL_CHAR_ON_FOOT: case OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE: case OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS: @@ -3007,13 +2998,13 @@ CPed::ForceStoredObjective(eObjective objective) case OBJECTIVE_ENTER_CAR_AS_DRIVER: case OBJECTIVE_GOTO_AREA_ON_FOOT: case OBJECTIVE_RUN_TO_AREA: - case OBJECTIVE_USE_SEAT_ATTRACTOR: - case OBJECTIVE_USE_ATM_ATTRACTOR: - case OBJECTIVE_USE_STOP_ATTRACTOR: - case OBJECTIVE_USE_PIZZA_ATTRACTOR: - case OBJECTIVE_USE_SHELTER_ATTRACTOR: - case OBJECTIVE_SPRINT_TO_COORD: - case OBJECTIVE_USE_ICECREAM_ATTRACTOR: + case OBJECTIVE_GOTO_SEAT_ON_FOOT: + case OBJECTIVE_GOTO_ATM_ON_FOOT: + case OBJECTIVE_GOTO_BUS_STOP_ON_FOOT: + case OBJECTIVE_GOTO_PIZZA_ON_FOOT: + case OBJECTIVE_GOTO_SHELTER_ON_FOOT: + case OBJECTIVE_SPRINT_TO_AREA: + case OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT: return; default: m_prevObjective = m_objective; @@ -3028,7 +3019,7 @@ CPed::SetStoredObjective(void) return; switch (m_objective) { - case OBJECTIVE_FLEE_TILL_SAFE: + case OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE: case OBJECTIVE_KILL_CHAR_ON_FOOT: case OBJECTIVE_KILL_CHAR_ANY_MEANS: case OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE: @@ -3040,13 +3031,13 @@ CPed::SetStoredObjective(void) case OBJECTIVE_ENTER_CAR_AS_DRIVER: case OBJECTIVE_GOTO_AREA_ON_FOOT: case OBJECTIVE_RUN_TO_AREA: - case OBJECTIVE_USE_SEAT_ATTRACTOR: - case OBJECTIVE_USE_ATM_ATTRACTOR: - case OBJECTIVE_USE_STOP_ATTRACTOR: - case OBJECTIVE_USE_PIZZA_ATTRACTOR: - case OBJECTIVE_USE_SHELTER_ATTRACTOR: - case OBJECTIVE_SPRINT_TO_COORD: - case OBJECTIVE_USE_ICECREAM_ATTRACTOR: + case OBJECTIVE_GOTO_SEAT_ON_FOOT: + case OBJECTIVE_GOTO_ATM_ON_FOOT: + case OBJECTIVE_GOTO_BUS_STOP_ON_FOOT: + case OBJECTIVE_GOTO_PIZZA_ON_FOOT: + case OBJECTIVE_GOTO_SHELTER_ON_FOOT: + case OBJECTIVE_SPRINT_TO_AREA: + case OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT: return; default: m_prevObjective = m_objective; @@ -3060,14 +3051,14 @@ CPed::RestorePreviousObjective(void) if (m_objective == OBJECTIVE_NONE) return; - if (m_objective != OBJECTIVE_LEAVE_VEHICLE && m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER && m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER + if (m_objective != OBJECTIVE_LEAVE_CAR && m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER && m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER && m_nPedState != PED_CARJACK) m_pedInObjective = nil; - if (m_objective == OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT) { + if (m_objective == OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT) { m_objective = OBJECTIVE_NONE; if (m_pMyVehicle) - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } else { m_objective = m_prevObjective; @@ -3106,13 +3097,13 @@ CPed::SetObjective(eObjective newObj, void *entity) case OBJECTIVE_KILL_CHAR_ON_FOOT: case OBJECTIVE_KILL_CHAR_ANY_MEANS: case OBJECTIVE_GOTO_CHAR_ON_FOOT: - case OBJECTIVE_FOLLOW_PED_IN_FORMATION: + case OBJECTIVE_FOLLOW_CHAR_IN_FORMATION: case OBJECTIVE_GOTO_AREA_ANY_MEANS: - case OBJECTIVE_FIGHT_CHAR: + case OBJECTIVE_GUARD_ATTACK: if (m_pedInObjective == entity) return; break; - case OBJECTIVE_LEAVE_VEHICLE: + case OBJECTIVE_LEAVE_CAR: case OBJECTIVE_FLEE_CAR: #ifdef VC_PED_PORTS case OBJECTIVE_LEAVE_CAR_AND_DIE: @@ -3121,7 +3112,7 @@ CPed::SetObjective(eObjective newObj, void *entity) case OBJECTIVE_ENTER_CAR_AS_PASSENGER: case OBJECTIVE_ENTER_CAR_AS_DRIVER: case OBJECTIVE_DESTROY_CAR: - case OBJECTIVE_SOLICIT: + case OBJECTIVE_SOLICIT_VEHICLE: case OBJECTIVE_BUY_ICE_CREAM: if (m_carInObjective == entity) return; @@ -3130,7 +3121,7 @@ CPed::SetObjective(eObjective newObj, void *entity) if (m_leader == entity) return; break; - case OBJECTIVE_AIM_GUN_AT_PED: + case OBJECTIVE_AIM_GUN_AT: if (m_pedInObjective == entity) return; break; @@ -3138,7 +3129,7 @@ CPed::SetObjective(eObjective newObj, void *entity) break; } } else { - if ((newObj == OBJECTIVE_LEAVE_VEHICLE + if ((newObj == OBJECTIVE_LEAVE_CAR #ifdef VC_PED_PORTS || newObj == OBJECTIVE_LEAVE_CAR_AND_DIE #endif @@ -3162,7 +3153,7 @@ CPed::SetObjective(eObjective newObj, void *entity) } switch (newObj) { - case OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT: + case OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT: // In this special case, entity parameter isn't CEntity, but int. SetObjectiveTimer((uintptr)entity); @@ -3183,17 +3174,17 @@ CPed::SetObjective(eObjective newObj, void *entity) case OBJECTIVE_GOTO_CHAR_ON_FOOT: case OBJECTIVE_GOTO_CHAR_ON_FOOT_WALKING: case OBJECTIVE_HASSLE_CHAR: - case OBJECTIVE_FIGHT_CHAR: + case OBJECTIVE_GUARD_ATTACK: m_vecSeekPos = CVector(0.0f, 0.0f, 0.0f); m_pedInObjective = (CPed*)entity; m_pedInObjective->RegisterReference((CEntity**)&m_pedInObjective); break; - case OBJECTIVE_FOLLOW_PED_IN_FORMATION: + case OBJECTIVE_FOLLOW_CHAR_IN_FORMATION: m_pedInObjective = (CPed*)entity; m_pedInObjective->RegisterReference((CEntity**)&m_pedInObjective); m_pedFormation = FORMATION_REAR; break; - case OBJECTIVE_LEAVE_VEHICLE: + case OBJECTIVE_LEAVE_CAR: #ifdef VC_PED_PORTS case OBJECTIVE_LEAVE_CAR_AND_DIE: #endif @@ -3222,14 +3213,14 @@ CPed::SetObjective(eObjective newObj, void *entity) } // fall through case OBJECTIVE_DESTROY_CAR: - case OBJECTIVE_SOLICIT: + case OBJECTIVE_SOLICIT_VEHICLE: case OBJECTIVE_BUY_ICE_CREAM: m_carInObjective = (CVehicle*)entity; m_carInObjective->RegisterReference((CEntity**)&m_carInObjective); m_pSeekTarget = m_carInObjective; m_pSeekTarget->RegisterReference((CEntity**)&m_pSeekTarget); m_vecSeekPos = CVector(0.0f, 0.0f, 0.0f); - if (newObj == OBJECTIVE_SOLICIT) { + if (newObj == OBJECTIVE_SOLICIT_VEHICLE) { m_objectiveTimer = CTimer::GetTimeInMilliseconds() + 10000; } else if (m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER && CharCreatedBy == MISSION_CHAR && (m_carInObjective->GetStatus() == STATUS_PLAYER_DISABLED || CPad::GetPad(CWorld::PlayerInFocus)->ArePlayerControlsDisabled())) { @@ -3242,7 +3233,7 @@ CPed::SetObjective(eObjective newObj, void *entity) SetLeader((CEntity*)entity); RestorePreviousObjective(); break; - case OBJECTIVE_AIM_GUN_AT_PED: + case OBJECTIVE_AIM_GUN_AT: m_pedInObjective = (CPed*)entity; m_pedInObjective->RegisterReference((CEntity**)&m_pedInObjective); break; @@ -3276,7 +3267,7 @@ CPed::SetObjective(eObjective newObj) return; if (newObj == OBJECTIVE_NONE) { - if ((m_objective == OBJECTIVE_LEAVE_VEHICLE || m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER + if ((m_objective == OBJECTIVE_LEAVE_CAR || m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER || m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE) && !IsPlayer() && !IsPedInControl()) { bStartWanderPathOnFoot = true; @@ -3373,6 +3364,7 @@ CPed::ClearChat(void) } } +// --MIAMI: Done bool CPed::IsGangMember(void) { @@ -3660,27 +3652,16 @@ CPed::CheckAroundForPossibleCollisions(void) bool CPed::MakePhonecall(void) { -#ifdef TOGGLEABLE_BETA_FEATURES - if (bMakePedsRunToPhonesToReportCrimes) - if (!IsPlayer() && CTimer::GetTimeInMilliseconds() > m_phoneTalkTimer - 7000 && bRunningToPhone) { - - FindPlayerPed()->m_pWanted->RegisterCrime_Immediately(m_crimeToReportOnPhone, GetPosition(), - (m_crimeToReportOnPhone == CRIME_POSSESSION_GUN ? (uintptr)m_threatEntity : (uintptr)((CPed*)m_pEventEntity)->m_threatEntity), false); - bRunningToPhone = false; - } -#endif if (CTimer::GetTimeInMilliseconds() <= m_phoneTalkTimer) return false; SetIdle(); gPhoneInfo.m_aPhones[m_phoneId].m_nState = PHONE_STATE_FREE; -#ifdef TOGGLEABLE_BETA_FEATURES - crimeReporters[m_phoneId] = nil; -#endif m_phoneId = -1; return true; } +// --MIAMI: Done bool CPed::FacePhone(void) { @@ -4737,7 +4718,7 @@ CPed::ClearObjective(void) if(!IsPlayer()) bWanderPathAfterExitingCar = true; - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } m_nLastPedState = PED_NONE; } else { @@ -6219,11 +6200,11 @@ CPed::CollideWithPed(CPed *collideWith) if ((!IsPlayer() || ((CPlayerPed*)this)->m_fMoveSpeed <= 1.8f) && (IsPlayer() || heIsMissionChar && weAreMissionChar || m_nMoveState != PEDMOVE_RUN && m_nMoveState != PEDMOVE_SPRINT - || m_objective == OBJECTIVE_FOLLOW_PED_IN_FORMATION && m_pedInObjective == collideWith - || collideWith->m_objective == OBJECTIVE_FOLLOW_PED_IN_FORMATION && collideWith->m_pedInObjective == this + || m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION && m_pedInObjective == collideWith + || collideWith->m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION && collideWith->m_pedInObjective == this )) { - if (m_objective != OBJECTIVE_FOLLOW_PED_IN_FORMATION && m_objective != OBJECTIVE_GOTO_CHAR_ON_FOOT) { + if (m_objective != OBJECTIVE_FOLLOW_CHAR_IN_FORMATION && m_objective != OBJECTIVE_GOTO_CHAR_ON_FOOT) { if (CTimer::GetTimeInMilliseconds() > m_nPedStateTimer) { @@ -8307,7 +8288,7 @@ CPed::Seek(void) if (m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER) { if (m_nPedState != PED_EXIT_TRAIN && m_nPedState != PED_ENTER_TRAIN && m_nPedState != PED_SEEK_IN_BOAT && - m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER && m_objective != OBJECTIVE_SOLICIT && !bDuckAndCover) { + m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER && m_objective != OBJECTIVE_SOLICIT_VEHICLE && !bDuckAndCover) { if ((!m_pedInObjective || !m_pedInObjective->bInVehicle) && !((CTimer::GetFrameCounter() + (m_randomSeed % 256) + 17) & 7)) { @@ -8332,7 +8313,7 @@ CPed::Seek(void) if (!m_pSeekTarget && m_nPedState == PED_SEEK_ENTITY) ClearSeek(); - if (m_objective == OBJECTIVE_FOLLOW_PED_IN_FORMATION && !m_pedInObjective) { + if (m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION && !m_pedInObjective) { m_objective = OBJECTIVE_NONE; ClearObjective(); SetWanderPath(0); @@ -8342,16 +8323,16 @@ CPed::Seek(void) float seekPosDist = (m_vecSeekPos - GetPosition()).Magnitude2D(); if (seekPosDist < 2.0f || m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT) { - if (m_objective == OBJECTIVE_FOLLOW_PED_IN_FORMATION) { + if (m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION) { if (m_pedInObjective->m_nMoveState != PEDMOVE_STILL) nextMove = m_pedInObjective->m_nMoveState; } else nextMove = PEDMOVE_WALK; - } else if (m_objective != OBJECTIVE_FOLLOW_PED_IN_FORMATION) { + } else if (m_objective != OBJECTIVE_FOLLOW_CHAR_IN_FORMATION) { - if (m_objective == OBJECTIVE_SPRINT_TO_COORD) + if (m_objective == OBJECTIVE_SPRINT_TO_AREA) nextMove = PEDMOVE_SPRINT; else if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS || m_objective == OBJECTIVE_RUN_TO_AREA || bIsRunning) nextMove = PEDMOVE_RUN; @@ -8450,13 +8431,13 @@ CPed::Seek(void) return false; } - if ((m_objective != OBJECTIVE_FOLLOW_PED_IN_FORMATION || m_pedInObjective->m_nMoveState == PEDMOVE_STILL) && m_nMoveState != PEDMOVE_STILL) { + if ((m_objective != OBJECTIVE_FOLLOW_CHAR_IN_FORMATION || m_pedInObjective->m_nMoveState == PEDMOVE_STILL) && m_nMoveState != PEDMOVE_STILL) { m_nPedStateTimer = 0; m_actionX = 0; m_actionY = 0; } - if (m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT || m_objective == OBJECTIVE_RUN_TO_AREA || m_objective == OBJECTIVE_SPRINT_TO_COORD || + if (m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT || m_objective == OBJECTIVE_RUN_TO_AREA || m_objective == OBJECTIVE_SPRINT_TO_AREA || m_objective == OBJECTIVE_GOTO_AREA_ANY_MEANS || IsUseAttractorObjective(m_objective)) { if (m_pNextPathNode) @@ -9653,10 +9634,6 @@ CPed::KillPedWithCar(CVehicle *car, float impulse) if (car->pDriver) { CEventList::RegisterEvent((m_nPedType == PEDTYPE_COP ? EVENT_HIT_AND_RUN_COP : EVENT_HIT_AND_RUN), EVENT_ENTITY_PED, this, car->pDriver, 1000); -#ifdef TOGGLEABLE_BETA_FEATURES - if (bMakePedsRunToPhonesToReportCrimes) - m_ped_flagI40 = true; -#endif } ePedPieceTypes pieceToDamage; @@ -10765,7 +10742,7 @@ CPed::ProcessControl(void) && (!IsPlayer() || m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT || m_objective == OBJECTIVE_RUN_TO_AREA - || m_objective == OBJECTIVE_SPRINT_TO_COORD + || m_objective == OBJECTIVE_SPRINT_TO_AREA || m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER)) { if (collidingVeh != m_pCurrentPhysSurface || IsPlayer()) { @@ -11306,7 +11283,7 @@ CPed::ProcessControl(void) bStartWanderPathOnFoot = false; } else if (m_nPedState == PED_DRIVING) { bWanderPathAfterExitingCar = true; - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } } @@ -11765,7 +11742,7 @@ CPed::PedAnimDoorCloseCB(CAnimBlendAssociation *animAssoc, void *arg) } else if (ped->m_vehEnterType == CAR_DOOR_RF && (veh->m_nGettingInFlags & CAR_DOOR_FLAG_LF || (veh->pDriver != nil && - (veh->pDriver->m_objective != OBJECTIVE_LEAVE_VEHICLE + (veh->pDriver->m_objective != OBJECTIVE_LEAVE_CAR && veh->pDriver->m_objective != OBJECTIVE_LEAVE_CAR_AND_DIE || !veh->IsRoomForPedToLeaveCar(CAR_DOOR_LF, nil))))) { @@ -11775,7 +11752,7 @@ CPed::PedAnimDoorCloseCB(CAnimBlendAssociation *animAssoc, void *arg) ped->m_objective = OBJECTIVE_ENTER_CAR_AS_PASSENGER; PedSetInCarCB(nil, ped); - ped->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh); + ped->SetObjective(OBJECTIVE_LEAVE_CAR, veh); if (!ped->IsPlayer()) ped->bFleeAfterExitingCar = true; @@ -11942,7 +11919,7 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg) } if (ped->m_vehEnterType == CAR_DOOR_RF && pedInSeat && veh->IsCar()) - pedInSeat->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh); + pedInSeat->SetObjective(OBJECTIVE_LEAVE_CAR, veh); } ped->m_pVehicleAnim->SetFinishCallback(PedAnimGetInCB, ped); @@ -12150,7 +12127,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg) CPed *driver = veh->pDriver; if (driver && (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || ped->m_nPedState == PED_CARJACK)) { if (veh->bIsBus) { - driver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh); + driver->SetObjective(OBJECTIVE_LEAVE_CAR, veh); if (driver->IsPlayer()) { veh->bIsHandbrakeOn = true; veh->SetStatus(STATUS_PLAYER_DISABLED); @@ -12161,7 +12138,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg) if (ped->m_nPedType == PEDTYPE_COP || ped->m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || ped->m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS) { - ped->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh); + ped->SetObjective(OBJECTIVE_LEAVE_CAR, veh); } ped->m_leaveCarTimer = CTimer::GetTimeInMilliseconds() + 400; return; @@ -12185,7 +12162,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg) } if ((ped->m_nPedType != PEDTYPE_EMERGENCY || veh->pDriver->m_nPedType != PEDTYPE_EMERGENCY) && (ped->m_nPedType != PEDTYPE_COP || veh->pDriver->m_nPedType != PEDTYPE_COP)) { - veh->pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh); + veh->pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, veh); veh->pDriver->Say(SOUND_PED_CAR_JACKED); veh->pDriver->SetRadioStation(); if (veh->m_nDoorLock == CARLOCK_UNLOCKED) @@ -12612,7 +12589,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg) // Situation of entering car as a driver while there is already a driver exiting atm. CPed *driver = veh->pDriver; - if (driver && driver->m_nPedState == PED_DRIVING && !veh->bIsBus && driver->m_objective == OBJECTIVE_LEAVE_VEHICLE + if (driver && driver->m_nPedState == PED_DRIVING && !veh->bIsBus && driver->m_objective == OBJECTIVE_LEAVE_CAR && (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || ped->m_nPedState == PED_CARJACK)) { if (!ped->IsPlayer() && (ped->CharCreatedBy != MISSION_CHAR || driver->IsPlayer())) { @@ -12717,7 +12694,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg) for (int i = 0; i < veh->m_nNumMaxPassengers; ++i) { CPed *passenger = veh->pPassengers[i]; if (passenger && !passenger->bStayInCarOnJack && !passenger->b156_8 && (passenger->m_leader != ped || !ped->bIsLeader)) { - passenger->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh); + passenger->SetObjective(OBJECTIVE_LEAVE_CAR, veh); passenger->m_leaveCarTimer = CTimer::GetTimeInMilliseconds(); } } @@ -12758,7 +12735,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg) if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) { if (ped->m_prevObjective == OBJECTIVE_RUN_TO_AREA || ped->m_prevObjective == OBJECTIVE_GOTO_CHAR_ON_FOOT - || ped->m_prevObjective == OBJECTIVE_SPRINT_TO_COORD || ped->m_prevObjective == OBJECTIVE_KILL_CHAR_ON_FOOT) + || ped->m_prevObjective == OBJECTIVE_SPRINT_TO_AREA || ped->m_prevObjective == OBJECTIVE_KILL_CHAR_ON_FOOT) ped->m_prevObjective = OBJECTIVE_NONE; ped->RestorePreviousObjective(); @@ -12794,12 +12771,12 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg) } ped->SetPedState(PED_DRIVING); if (ped->m_prevObjective == OBJECTIVE_RUN_TO_AREA || ped->m_prevObjective == OBJECTIVE_GOTO_CHAR_ON_FOOT - || ped->m_prevObjective == OBJECTIVE_SPRINT_TO_COORD || ped->m_prevObjective == OBJECTIVE_KILL_CHAR_ON_FOOT) + || ped->m_prevObjective == OBJECTIVE_SPRINT_TO_AREA || ped->m_prevObjective == OBJECTIVE_KILL_CHAR_ON_FOOT) ped->m_prevObjective = OBJECTIVE_NONE; ped->RestorePreviousObjective(); - // VC has conditional OBJECTIVE_LEAVE_VEHICLE here, which runs if it entered the first dead condition. + // VC has conditional OBJECTIVE_LEAVE_CAR here, which runs if it entered the first dead condition. if(slowDown) veh->AutoPilot.m_nCruiseSpeed = 17; @@ -12820,18 +12797,18 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg) switch (ped->m_objective) { case OBJECTIVE_KILL_CHAR_ON_FOOT: case OBJECTIVE_KILL_CHAR_ANY_MEANS: - case OBJECTIVE_LEAVE_VEHICLE: + case OBJECTIVE_LEAVE_CAR: case OBJECTIVE_FOLLOW_CAR_IN_CAR: case OBJECTIVE_GOTO_AREA_ANY_MEANS: case OBJECTIVE_GOTO_AREA_ON_FOOT: case OBJECTIVE_RUN_TO_AREA: - case OBJECTIVE_USE_SEAT_ATTRACTOR: - case OBJECTIVE_USE_ATM_ATTRACTOR: - case OBJECTIVE_USE_STOP_ATTRACTOR: - case OBJECTIVE_USE_PIZZA_ATTRACTOR: - case OBJECTIVE_USE_SHELTER_ATTRACTOR: - case OBJECTIVE_SPRINT_TO_COORD: - case OBJECTIVE_USE_ICECREAM_ATTRACTOR: + case OBJECTIVE_GOTO_SEAT_ON_FOOT: + case OBJECTIVE_GOTO_ATM_ON_FOOT: + case OBJECTIVE_GOTO_BUS_STOP_ON_FOOT: + case OBJECTIVE_GOTO_PIZZA_ON_FOOT: + case OBJECTIVE_GOTO_SHELTER_ON_FOOT: + case OBJECTIVE_SPRINT_TO_AREA: + case OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT: break; default: ped->SetObjective(OBJECTIVE_NONE); @@ -12885,21 +12862,13 @@ CPed::PedStaggerCB(CAnimBlendAssociation* animAssoc, void* arg) */ } -// It's "CPhoneInfo::ProcessNearestFreePhone" in PC IDB, but it's not true, someone made it up. +// --MIAMI: Done bool CPed::RunToReportCrime(eCrimeType crimeToReport) { -#ifdef TOGGLEABLE_BETA_FEATURES - if (!bMakePedsRunToPhonesToReportCrimes) - return false; - - if (bRunningToPhone) - return true; -#else // They changed true into false to make this function unusable. So running to phone actually starts but first frame after that cancels it. if (m_nPedState == PED_SEEK_POS) return false; -#endif CVector pos = GetPosition(); int phoneId = gPhoneInfo.FindNearestFreePhone(&pos); @@ -12912,9 +12881,8 @@ CPed::RunToReportCrime(eCrimeType crimeToReport) return false; bRunningToPhone = true; - SetSeek(phone->m_pEntity->GetPosition() - phone->m_pEntity->GetForward(), 1.3f); // original: phone.m_vecPos, 0.3f + SetSeek(phone->m_vecPos, 0.3f); SetMoveState(PEDMOVE_RUN); - bIsRunning = true; // not there in original m_phoneId = phoneId; m_crimeToReportOnPhone = crimeToReport; return true; @@ -13078,7 +13046,7 @@ CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg) if (veh && veh->IsBoat()) ped->ApplyMoveSpeed(); - if (ped->m_objective == OBJECTIVE_LEAVE_VEHICLE) + if (ped->m_objective == OBJECTIVE_LEAVE_CAR) ped->RestorePreviousObjective(); else if (ped->m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE) { ped->m_fHealth = 0.0f; @@ -13727,13 +13695,13 @@ CPed::ProcessObjective(void) case OBJECTIVE_NONE: case OBJECTIVE_GUARD_AREA: case OBJECTIVE_FOLLOW_CAR_IN_CAR: - case OBJECTIVE_FIRE_AT_OBJ_FROM_VEHICLE: - case OBJECTIVE_DESTROY_OBJ: + case OBJECTIVE_FIRE_AT_OBJECT_FROM_VEHICLE: + case OBJECTIVE_DESTROY_OBJECT: case OBJECTIVE_GOTO_AREA_IN_CAR: case OBJECTIVE_FOLLOW_CAR_ON_FOOT_WITH_OFFSET: case OBJECTIVE_SET_LEADER: break; - case OBJECTIVE_IDLE: + case OBJECTIVE_WAIT_ON_FOOT: if (GetPedState() == PED_DRIVING) m_objective = OBJECTIVE_NONE; else { @@ -13750,9 +13718,9 @@ CPed::ProcessObjective(void) } } break; - case OBJECTIVE_FLEE_TILL_SAFE: + case OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE: if (InVehicle()) { - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); bFleeAfterExitingCar = true; } else if (m_nPedState != PED_FLEE_POS) { SetFlee(GetPosition(), 10000); @@ -13794,7 +13762,7 @@ CPed::ProcessObjective(void) case OBJECTIVE_WAIT_IN_CAR: m_nPedState = PED_DRIVING; break; - case OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT: + case OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT: m_nPedState = PED_DRIVING; break; case OBJECTIVE_KILL_CHAR_ANY_MEANS: @@ -13804,7 +13772,7 @@ CPed::ProcessObjective(void) && m_nPedType != PEDTYPE_COP && FindPlayerPed()->m_pWanted->m_CurrentCops && !bKindaStayInSamePlace) { - SetObjective(OBJECTIVE_FLEE_TILL_SAFE); + SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE); break; } if (InVehicle()) { @@ -13830,7 +13798,7 @@ CPed::ProcessObjective(void) || targetHasVeh && m_pedInObjective->m_pMyVehicle->CanPedExitCar(false)) { m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0; m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_NONE; - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } } break; @@ -13907,7 +13875,7 @@ CPed::ProcessObjective(void) { bool killPlayerInNoPoliceZone = false; if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT && InVehicle()) { - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); break; } @@ -13972,7 +13940,7 @@ CPed::ProcessObjective(void) } if (m_pedInObjective->IsPlayer() && m_nPedType != PEDTYPE_COP && CharCreatedBy != MISSION_CHAR && FindPlayerPed()->m_pWanted->m_CurrentCops) { - SetObjective(OBJECTIVE_FLEE_TILL_SAFE); + SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE); break; } if (m_pedInObjective->m_fHealth <= 0.0f) { @@ -14263,7 +14231,7 @@ CPed::ProcessObjective(void) { if (InVehicle()) { if (m_nPedState == PED_DRIVING) - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } else if (m_nPedState != PED_FLEE_ENTITY) { int time; if (m_objective == OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS) @@ -14331,7 +14299,7 @@ CPed::ProcessObjective(void) } break; } - case OBJECTIVE_FOLLOW_PED_IN_FORMATION: + case OBJECTIVE_FOLLOW_CHAR_IN_FORMATION: { if (m_pedInObjective) { CVector posToGo = GetFormationPosition(); @@ -14576,7 +14544,7 @@ CPed::ProcessObjective(void) if (distWithTarget.MagnitudeSqr() < sq(20.0f)) { m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0; ForceStoredObjective(OBJECTIVE_GOTO_AREA_ANY_MEANS); - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } break; } @@ -14617,11 +14585,11 @@ CPed::ProcessObjective(void) } case OBJECTIVE_GOTO_AREA_ON_FOOT: case OBJECTIVE_RUN_TO_AREA: - case OBJECTIVE_SPRINT_TO_COORD: + case OBJECTIVE_SPRINT_TO_AREA: { - if ((m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT || m_objective == OBJECTIVE_RUN_TO_AREA || m_objective == OBJECTIVE_SPRINT_TO_COORD) + if ((m_objective == OBJECTIVE_GOTO_AREA_ON_FOOT || m_objective == OBJECTIVE_RUN_TO_AREA || m_objective == OBJECTIVE_SPRINT_TO_AREA) && InVehicle()) { - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } else { distWithTarget = m_nextRoutePointPos - GetPosition(); distWithTarget.z = 0.0f; @@ -14657,7 +14625,7 @@ CPed::ProcessObjective(void) break; } - case OBJECTIVE_FIGHT_CHAR: + case OBJECTIVE_GUARD_ATTACK: { if (m_pedInObjective) { SetLookFlag(m_pedInObjective, true); @@ -14690,7 +14658,7 @@ CPed::ProcessObjective(void) SetSeek(m_nextRoutePointPos, 0.8f); } break; - case OBJECTIVE_SOLICIT: + case OBJECTIVE_SOLICIT_VEHICLE: if (m_carInObjective) { if (m_objectiveTimer <= CTimer::GetTimeInMilliseconds()) { if (!bInVehicle) { @@ -14895,7 +14863,7 @@ CPed::ProcessObjective(void) break; } // fall through - case OBJECTIVE_LEAVE_VEHICLE: + case OBJECTIVE_LEAVE_CAR: if (CTimer::GetTimeInMilliseconds() > m_leaveCarTimer) { if (InVehicle() && (FindPlayerPed() != this || !CPad::GetPad(0)->GetAccelerate() @@ -14921,7 +14889,7 @@ CPed::ProcessObjective(void) } } break; - case OBJECTIVE_AIM_GUN_AT_PED: + case OBJECTIVE_AIM_GUN_AT: if (m_pedInObjective) { if (!bObstacleShowedUpDuringKillObjective) SetPointGunAt(m_pedInObjective); @@ -14962,12 +14930,12 @@ CPed::ProcessObjective(void) } break; } - case OBJECTIVE_USE_SEAT_ATTRACTOR: - case OBJECTIVE_USE_ATM_ATTRACTOR: - case OBJECTIVE_USE_STOP_ATTRACTOR: - case OBJECTIVE_USE_PIZZA_ATTRACTOR: - case OBJECTIVE_USE_SHELTER_ATTRACTOR: - case OBJECTIVE_USE_ICECREAM_ATTRACTOR: + case OBJECTIVE_GOTO_SEAT_ON_FOOT: + case OBJECTIVE_GOTO_ATM_ON_FOOT: + case OBJECTIVE_GOTO_BUS_STOP_ON_FOOT: + case OBJECTIVE_GOTO_PIZZA_ON_FOOT: + case OBJECTIVE_GOTO_SHELTER_ON_FOOT: + case OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT: if (CTimer::GetTimeInMilliseconds() > m_objectiveTimer) { m_objectiveTimer = 0; if (m_attractor) @@ -14976,7 +14944,7 @@ CPed::ProcessObjective(void) else { CVector distance = m_nextRoutePointPos - GetPosition(); distance.z = 0.0f; - if (m_objective == OBJECTIVE_USE_SHELTER_ATTRACTOR) { + if (m_objective == OBJECTIVE_GOTO_SHELTER_ON_FOOT) { if (m_nMoveState == PEDMOVE_SPRINT && distance.Magnitude() < SQR(2.0f)) { SetMoveState(PEDMOVE_WALK); bIsRunning = false; @@ -14986,7 +14954,7 @@ CPed::ProcessObjective(void) return; } } - else if (m_objective == OBJECTIVE_USE_ICECREAM_ATTRACTOR) { + else if (m_objective == OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT) { if (m_nMoveState == PEDMOVE_SPRINT && distance.Magnitude() < SQR(4.0f)) { SetMoveState(PEDMOVE_WALK); bIsRunning = false; @@ -15051,7 +15019,7 @@ CPed::ProcessObjective(void) GetPedAttractorManager()->BroadcastArrival(this, m_attractor); if (GetPedAttractorManager()->IsAtHeadOfQueue(this, m_attractor)) { switch (m_objective) { - case OBJECTIVE_USE_SEAT_ATTRACTOR: + case OBJECTIVE_GOTO_SEAT_ON_FOOT: if (!bTurnedAroundOnAttractor) { ClearObjective(); SetWaitState(WAITSTATE_SIT_DOWN, 0); @@ -15061,27 +15029,27 @@ CPed::ProcessObjective(void) SetWaitState(WAITSTATE_SIT_DOWN_RVRS, 0); } break; - case OBJECTIVE_USE_ATM_ATTRACTOR: + case OBJECTIVE_GOTO_ATM_ON_FOOT: ClearObjective(); SetWaitState(WAITSTATE_USE_ATM, 0); break; - case OBJECTIVE_USE_STOP_ATTRACTOR: + case OBJECTIVE_GOTO_BUS_STOP_ON_FOOT: ClearObjective(); - SetObjective(OBJECTIVE_WAIT_FOR_BUS); + SetObjective(OBJECTIVE_WAIT_ON_FOOT_AT_BUS_STOP); break; - case OBJECTIVE_USE_PIZZA_ATTRACTOR: + case OBJECTIVE_GOTO_PIZZA_ON_FOOT: ClearObjective(); m_prevObjective = OBJECTIVE_NONE; - SetObjective(OBJECTIVE_IDLE); + SetObjective(OBJECTIVE_WAIT_ON_FOOT); m_objectiveTimer = CTimer::GetTimeInMilliseconds() + m_attractor->GetHeadOfQueueWaitTime(); break; - case OBJECTIVE_USE_SHELTER_ATTRACTOR: + case OBJECTIVE_GOTO_SHELTER_ON_FOOT: m_prevObjective = OBJECTIVE_NONE; - SetObjective(OBJECTIVE_WAIT_FOR_RAIN_TO_END); + SetObjective(OBJECTIVE_WAIT_ON_FOOT_AT_SHELTER); break; - case OBJECTIVE_USE_ICECREAM_ATTRACTOR: + case OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT: m_prevObjective = OBJECTIVE_NONE; - SetObjective(OBJECTIVE_PURCHASE_ICECREAM); + SetObjective(OBJECTIVE_WAIT_ON_FOOT_AT_ICE_CREAM_VAN); break; } } @@ -15089,12 +15057,12 @@ CPed::ProcessObjective(void) } } return; - case OBJECTIVE_WAIT_FOR_RAIN_TO_END: + case OBJECTIVE_WAIT_ON_FOOT_AT_SHELTER: SetIdle(); if (m_attractor && CWeather::Rain < 0.2f) GetPedAttractorManager()->DeRegisterPed(this, m_attractor); break; - case OBJECTIVE_WAIT_FOR_BUS: + case OBJECTIVE_WAIT_ON_FOOT_AT_BUS_STOP: SetIdle(); if (m_attractor) { float left = GetPosition().x - 10.0f; @@ -15134,7 +15102,7 @@ CPed::ProcessObjective(void) if (pBus) { if (pBus->m_nNumPassengers >= pBus->m_nNumMaxPassengers - 1) - SetObjective(OBJECTIVE_IDLE); + SetObjective(OBJECTIVE_WAIT_ON_FOOT); else { GetPedAttractorManager()->DeRegisterPed(this, m_attractor); SetObjective(OBJECTIVE_ENTER_CAR_AS_PASSENGER, pBus); @@ -15303,14 +15271,11 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj) if (m_nMoveState == PEDMOVE_NONE || m_nMoveState == PEDMOVE_STILL) return; -#ifdef TOGGLEABLE_BETA_FEATURES - if (!bMakePedsRunToPhonesToReportCrimes) -#endif - if (CharCreatedBy != MISSION_CHAR && obj->GetModelIndex() == MI_PHONEBOOTH1) { - bool isRunning = m_nMoveState == PEDMOVE_RUN || m_nMoveState == PEDMOVE_SPRINT; - SetFindPathAndFlee(obj, 5000, !isRunning); - return; - } + if (CharCreatedBy != MISSION_CHAR && obj->GetModelIndex() == MI_PHONEBOOTH1) { + bool isRunning = m_nMoveState == PEDMOVE_RUN || m_nMoveState == PEDMOVE_SPRINT; + SetFindPathAndFlee(obj, 5000, !isRunning); + return; + } CVector2D adjustedColMin(objColMin.x - 0.35f, objColMin.y - 0.35f); CVector2D adjustedColMax(objColMax.x + 0.35f, objColMax.y + 0.35f); @@ -15375,7 +15340,7 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj) } if (m_pSeekTarget == obj && obj->IsVehicle()) { if (m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER - || m_objective == OBJECTIVE_SOLICIT) { + || m_objective == OBJECTIVE_SOLICIT_VEHICLE) { goingToEnterCar = true; if (IsPlayer()) checkIntervalInTime = 0.0f; @@ -17231,7 +17196,7 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode) default: break; } - if (someoneEntersFromOurExitDoor && m_objective == OBJECTIVE_LEAVE_VEHICLE) { + if (someoneEntersFromOurExitDoor && m_objective == OBJECTIVE_LEAVE_CAR) { RestorePreviousObjective(); return; } @@ -17578,7 +17543,7 @@ CPed::ScanForInterestingStuff(void) if (veh->IsVehicleNormal()) { if (veh->IsCar()) { if ((GetPosition() - veh->GetPosition()).Magnitude() < 5.0f && veh->IsRoomForPedToLeaveCar(CAR_DOOR_LF, nil)) { - SetObjective(OBJECTIVE_SOLICIT, veh); + SetObjective(OBJECTIVE_SOLICIT_VEHICLE, veh); Say(SOUND_PED_SOLICIT); return; } @@ -17883,7 +17848,7 @@ CPed::SeekCar(void) m_fRotationCur = m_fRotationDest; if (!bVehEnterDoorIsBlocked) { vehToSeek->bIsStatic = false; - if (m_objective == OBJECTIVE_SOLICIT) { + if (m_objective == OBJECTIVE_SOLICIT_VEHICLE) { SetSolicit(1000); } else if (m_objective == OBJECTIVE_BUY_ICE_CREAM) { SetBuyIceCream(); @@ -18228,14 +18193,14 @@ CPed::UpdateFromLeader(void) if (m_leader->m_nPedState == PED_DEAD) { SetLeader(nil); - SetObjective(OBJECTIVE_FLEE_TILL_SAFE); + SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE); return; } if (!m_leader->bInVehicle) { if (m_leader->m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER) { if (bInVehicle) { - if (m_objective != OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT && m_objective != OBJECTIVE_LEAVE_VEHICLE) - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + if (m_objective != OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT && m_objective != OBJECTIVE_LEAVE_CAR) + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); return; } @@ -18250,12 +18215,12 @@ CPed::UpdateFromLeader(void) } } if (bInVehicle || !m_leader->bInVehicle || m_leader->m_nPedState != PED_DRIVING) { - if (m_leader->m_objective != OBJECTIVE_NONE && (!m_leader->IsPlayer() || m_leader->m_objective != OBJECTIVE_IDLE) + if (m_leader->m_objective != OBJECTIVE_NONE && (!m_leader->IsPlayer() || m_leader->m_objective != OBJECTIVE_WAIT_ON_FOOT) && m_objective != m_leader->m_objective) { switch (m_leader->m_objective) { - case OBJECTIVE_IDLE: - case OBJECTIVE_FLEE_TILL_SAFE: + case OBJECTIVE_WAIT_ON_FOOT: + case OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE: case OBJECTIVE_WAIT_IN_CAR: case OBJECTIVE_FOLLOW_ROUTE: SetObjective(m_leader->m_objective); @@ -18280,7 +18245,7 @@ CPed::UpdateFromLeader(void) return; } break; - case OBJECTIVE_FIGHT_CHAR: + case OBJECTIVE_GUARD_ATTACK: return; case OBJECTIVE_HAIL_TAXI: m_leader = nil; @@ -18340,7 +18305,7 @@ CPed::UpdateFromLeader(void) } } } else if (bInVehicle) { - if ((!m_leader->bInVehicle || m_leader->m_nPedState == PED_EXIT_CAR) && m_objective != OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT) { + if ((!m_leader->bInVehicle || m_leader->m_nPedState == PED_EXIT_CAR) && m_objective != OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT) { switch (m_leader->m_objective) { case OBJECTIVE_ENTER_CAR_AS_PASSENGER: @@ -18350,11 +18315,11 @@ CPed::UpdateFromLeader(void) // fall through default: - if (m_pMyVehicle && m_objective != OBJECTIVE_LEAVE_VEHICLE) { + if (m_pMyVehicle && m_objective != OBJECTIVE_LEAVE_CAR) { #ifdef VC_PED_PORTS m_leaveCarTimer = CTimer::GetTimeInMilliseconds() + 250; #endif - SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle); + SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle); } break; @@ -18702,12 +18667,12 @@ void CPed::SetObjective(eObjective newObj, float heading, const CVector& pos) { switch (newObj) { - case OBJECTIVE_USE_SEAT_ATTRACTOR: - case OBJECTIVE_USE_ATM_ATTRACTOR: - case OBJECTIVE_USE_STOP_ATTRACTOR: - case OBJECTIVE_USE_PIZZA_ATTRACTOR: - case OBJECTIVE_USE_SHELTER_ATTRACTOR: - case OBJECTIVE_USE_ICECREAM_ATTRACTOR: + case OBJECTIVE_GOTO_SEAT_ON_FOOT: + case OBJECTIVE_GOTO_ATM_ON_FOOT: + case OBJECTIVE_GOTO_BUS_STOP_ON_FOOT: + case OBJECTIVE_GOTO_PIZZA_ON_FOOT: + case OBJECTIVE_GOTO_SHELTER_ON_FOOT: + case OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT: ClearPointGunAt(); SetObjective(newObj, pos); m_attractorHeading = heading; @@ -18725,7 +18690,7 @@ CPed::SetObjective(eObjective newObj, CVector dest) return; if (m_objective == newObj) { - if (newObj == OBJECTIVE_GOTO_AREA_ANY_MEANS || newObj == OBJECTIVE_GOTO_AREA_ON_FOOT || newObj == OBJECTIVE_RUN_TO_AREA || newObj == OBJECTIVE_SPRINT_TO_COORD) { + if (newObj == OBJECTIVE_GOTO_AREA_ANY_MEANS || newObj == OBJECTIVE_GOTO_AREA_ON_FOOT || newObj == OBJECTIVE_RUN_TO_AREA || newObj == OBJECTIVE_SPRINT_TO_AREA) { if (m_nextRoutePointPos == dest) return; } else if (newObj == OBJECTIVE_GUARD_SPOT) { @@ -18745,7 +18710,7 @@ CPed::SetObjective(eObjective newObj, CVector dest) break; case OBJECTIVE_GUARD_AREA: case OBJECTIVE_WAIT_IN_CAR: - case OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT: + case OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT: case OBJECTIVE_KILL_CHAR_ON_FOOT: case OBJECTIVE_KILL_CHAR_ANY_MEANS: case OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE: @@ -18753,20 +18718,20 @@ CPed::SetObjective(eObjective newObj, CVector dest) case OBJECTIVE_GOTO_CHAR_ON_FOOT: case OBJECTIVE_GOTO_CHAR_ON_FOOT_WALKING: case OBJECTIVE_HASSLE_CHAR: - case OBJECTIVE_FOLLOW_PED_IN_FORMATION: - case OBJECTIVE_LEAVE_VEHICLE: + case OBJECTIVE_FOLLOW_CHAR_IN_FORMATION: + case OBJECTIVE_LEAVE_CAR: case OBJECTIVE_ENTER_CAR_AS_PASSENGER: case OBJECTIVE_ENTER_CAR_AS_DRIVER: case OBJECTIVE_FOLLOW_CAR_IN_CAR: - case OBJECTIVE_FIRE_AT_OBJ_FROM_VEHICLE: - case OBJECTIVE_DESTROY_OBJ: + case OBJECTIVE_FIRE_AT_OBJECT_FROM_VEHICLE: + case OBJECTIVE_DESTROY_OBJECT: case OBJECTIVE_DESTROY_CAR: case OBJECTIVE_GOTO_AREA_IN_CAR: case OBJECTIVE_FOLLOW_CAR_ON_FOOT_WITH_OFFSET: - case OBJECTIVE_FIGHT_CHAR: + case OBJECTIVE_GUARD_ATTACK: case OBJECTIVE_SET_LEADER: case OBJECTIVE_FOLLOW_ROUTE: - case OBJECTIVE_SOLICIT: + case OBJECTIVE_SOLICIT_VEHICLE: case OBJECTIVE_HAIL_TAXI: case OBJECTIVE_CATCH_TRAIN: case OBJECTIVE_BUY_ICE_CREAM: @@ -18776,48 +18741,48 @@ CPed::SetObjective(eObjective newObj, CVector dest) case OBJECTIVE_LEAVE_CAR_AND_DIE: case OBJECTIVE_FLEE_CAR: case OBJECTIVE_SUN_BATHE: - case OBJECTIVE_AIM_GUN_AT_PED: + case OBJECTIVE_AIM_GUN_AT: case OBJECTIVE_WANDER: - case OBJECTIVE_WAIT_FOR_RAIN_TO_END: + case OBJECTIVE_WAIT_ON_FOOT_AT_SHELTER: case OBJECTIVE_KILL_CHAR_ON_BOAT: case OBJECTIVE_SOLICIT_FOOT: - case OBJECTIVE_WAIT_FOR_BUS: + case OBJECTIVE_WAIT_ON_FOOT_AT_BUS_STOP: break; case OBJECTIVE_GOTO_AREA_ANY_MEANS: case OBJECTIVE_GOTO_AREA_ON_FOOT: - case OBJECTIVE_USE_SEAT_ATTRACTOR: - case OBJECTIVE_USE_ATM_ATTRACTOR: - case OBJECTIVE_USE_STOP_ATTRACTOR: - case OBJECTIVE_USE_PIZZA_ATTRACTOR: - case OBJECTIVE_USE_SHELTER_ATTRACTOR: - case OBJECTIVE_USE_ICECREAM_ATTRACTOR: + case OBJECTIVE_GOTO_SEAT_ON_FOOT: + case OBJECTIVE_GOTO_ATM_ON_FOOT: + case OBJECTIVE_GOTO_BUS_STOP_ON_FOOT: + case OBJECTIVE_GOTO_PIZZA_ON_FOOT: + case OBJECTIVE_GOTO_SHELTER_ON_FOOT: + case OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT: bIsRunning = false; m_pNextPathNode = nil; m_nextRoutePointPos = dest; m_vecSeekPos = m_nextRoutePointPos; m_distanceToCountSeekDone = 0.5f; - if (m_objective == OBJECTIVE_USE_ATM_ATTRACTOR) { + if (m_objective == OBJECTIVE_GOTO_ATM_ON_FOOT) { m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone(); m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading(); } - if (m_objective == OBJECTIVE_USE_SEAT_ATTRACTOR) { + if (m_objective == OBJECTIVE_GOTO_SEAT_ON_FOOT) { m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone(); m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading(); } - if (m_objective == OBJECTIVE_USE_STOP_ATTRACTOR) { + if (m_objective == OBJECTIVE_GOTO_BUS_STOP_ON_FOOT) { m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone(); m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading(); } - if (m_objective == OBJECTIVE_USE_PIZZA_ATTRACTOR) { + if (m_objective == OBJECTIVE_GOTO_PIZZA_ON_FOOT) { m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone(); m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading(); } - if (m_objective == OBJECTIVE_USE_SHELTER_ATTRACTOR) { + if (m_objective == OBJECTIVE_GOTO_SHELTER_ON_FOOT) { bIsRunning = true; m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone(); m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading(); } - if (m_objective == OBJECTIVE_USE_ICECREAM_ATTRACTOR) { + if (m_objective == OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT) { bIsRunning = true; m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone(); m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading(); @@ -18831,7 +18796,7 @@ CPed::SetObjective(eObjective newObj, CVector dest) } break; case OBJECTIVE_RUN_TO_AREA: - case OBJECTIVE_SPRINT_TO_COORD: + case OBJECTIVE_SPRINT_TO_AREA: bIsRunning = true; m_pNextPathNode = nil; m_nextRoutePointPos = dest; @@ -19452,12 +19417,12 @@ CPed::SetNewAttraction(CPedAttractor* pAttractor, const CVector& pos, float head if (m_attractor != pAttractor) return; switch (pAttractor->GetEffect()->pedattr.type) { - case ATTRACTOR_ATM: SetObjective(OBJECTIVE_USE_ATM_ATTRACTOR, heading, pos); break; - case ATTRACTOR_SEAT: SetObjective(OBJECTIVE_USE_SEAT_ATTRACTOR, heading, pos); break; - case ATTRACTOR_STOP: SetObjective(OBJECTIVE_USE_STOP_ATTRACTOR, heading, pos); break; - case ATTRACTOR_PIZZA: SetObjective(OBJECTIVE_USE_PIZZA_ATTRACTOR, heading, pos); break; - case ATTRACTOR_SHELTER: SetObjective(OBJECTIVE_USE_SHELTER_ATTRACTOR, heading, pos); break; - case ATTRACTOR_ICECREAM: SetObjective(OBJECTIVE_USE_ICECREAM_ATTRACTOR, heading, pos); break; + case ATTRACTOR_ATM: SetObjective(OBJECTIVE_GOTO_ATM_ON_FOOT, heading, pos); break; + case ATTRACTOR_SEAT: SetObjective(OBJECTIVE_GOTO_SEAT_ON_FOOT, heading, pos); break; + case ATTRACTOR_STOP: SetObjective(OBJECTIVE_GOTO_BUS_STOP_ON_FOOT, heading, pos); break; + case ATTRACTOR_PIZZA: SetObjective(OBJECTIVE_GOTO_PIZZA_ON_FOOT, heading, pos); break; + case ATTRACTOR_SHELTER: SetObjective(OBJECTIVE_GOTO_SHELTER_ON_FOOT, heading, pos); break; + case ATTRACTOR_ICECREAM: SetObjective(OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT, heading, pos); break; default: return; } SetObjectiveTimer(time); @@ -19929,7 +19894,7 @@ CPed::PedShuffle(void) { if (m_pMyVehicle->pPassengers[0] == this) { CPed *driver = m_pMyVehicle->pDriver; - if (!driver || driver->m_objective == OBJECTIVE_LEAVE_VEHICLE) { + if (!driver || driver->m_objective == OBJECTIVE_LEAVE_CAR) { m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, m_pMyVehicle->bLowVehicle ? ANIM_CAR_LSHUFFLE_RHS : ANIM_CAR_SHUFFLE_RHS); m_objective = OBJECTIVE_ENTER_CAR_AS_DRIVER; m_pMyVehicle->RemovePassenger(this); diff --git a/src/peds/Ped.h b/src/peds/Ped.h index e1795f55..457036d3 100644 --- a/src/peds/Ped.h +++ b/src/peds/Ped.h @@ -181,13 +181,13 @@ enum eWaitState { enum eObjective : uint32 { OBJECTIVE_NONE, - OBJECTIVE_IDLE, - OBJECTIVE_IDLE_COP, - OBJECTIVE_FLEE_TILL_SAFE, + OBJECTIVE_WAIT_ON_FOOT, + OBJECTIVE_WAIT_ON_FOOT_FOR_COP, + OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE, OBJECTIVE_GUARD_SPOT, - OBJECTIVE_GUARD_AREA, // not implemented + OBJECTIVE_GUARD_AREA, OBJECTIVE_WAIT_IN_CAR, - OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT, + OBJECTIVE_WAIT_IN_CAR_THEN_GET_OUT, OBJECTIVE_KILL_CHAR_ON_FOOT, OBJECTIVE_KILL_CHAR_ANY_MEANS, OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE, @@ -195,23 +195,23 @@ enum eObjective : uint32 { OBJECTIVE_GOTO_CHAR_ON_FOOT, OBJECTIVE_GOTO_CHAR_ON_FOOT_WALKING, OBJECTIVE_HASSLE_CHAR, - OBJECTIVE_FOLLOW_PED_IN_FORMATION, - OBJECTIVE_LEAVE_VEHICLE, + OBJECTIVE_FOLLOW_CHAR_IN_FORMATION, + OBJECTIVE_LEAVE_CAR, OBJECTIVE_ENTER_CAR_AS_PASSENGER, OBJECTIVE_ENTER_CAR_AS_DRIVER, - OBJECTIVE_FOLLOW_CAR_IN_CAR, // seems not implemented so far - OBJECTIVE_FIRE_AT_OBJ_FROM_VEHICLE, // not implemented - OBJECTIVE_DESTROY_OBJ, // not implemented + OBJECTIVE_FOLLOW_CAR_IN_CAR, + OBJECTIVE_FIRE_AT_OBJECT_FROM_VEHICLE, + OBJECTIVE_DESTROY_OBJECT, OBJECTIVE_DESTROY_CAR, OBJECTIVE_GOTO_AREA_ANY_MEANS, OBJECTIVE_GOTO_AREA_ON_FOOT, OBJECTIVE_RUN_TO_AREA, - OBJECTIVE_GOTO_AREA_IN_CAR, // not implemented - OBJECTIVE_FOLLOW_CAR_ON_FOOT_WITH_OFFSET, // not implemented - OBJECTIVE_FIGHT_CHAR, + OBJECTIVE_GOTO_AREA_IN_CAR, + OBJECTIVE_FOLLOW_CAR_ON_FOOT_WITH_OFFSET, + OBJECTIVE_GUARD_ATTACK, OBJECTIVE_SET_LEADER, OBJECTIVE_FOLLOW_ROUTE, - OBJECTIVE_SOLICIT, + OBJECTIVE_SOLICIT_VEHICLE, OBJECTIVE_HAIL_TAXI, OBJECTIVE_CATCH_TRAIN, OBJECTIVE_BUY_ICE_CREAM, @@ -219,22 +219,22 @@ enum eObjective : uint32 { OBJECTIVE_STEAL_ANY_MISSION_CAR, OBJECTIVE_MUG_CHAR, OBJECTIVE_LEAVE_CAR_AND_DIE, - OBJECTIVE_USE_SEAT_ATTRACTOR, - OBJECTIVE_USE_ATM_ATTRACTOR, + OBJECTIVE_GOTO_SEAT_ON_FOOT, + OBJECTIVE_GOTO_ATM_ON_FOOT, OBJECTIVE_FLEE_CAR, OBJECTIVE_SUN_BATHE, - OBJECTIVE_USE_STOP_ATTRACTOR, - OBJECTIVE_USE_PIZZA_ATTRACTOR, - OBJECTIVE_USE_SHELTER_ATTRACTOR, - OBJECTIVE_AIM_GUN_AT_PED, + OBJECTIVE_GOTO_BUS_STOP_ON_FOOT, + OBJECTIVE_GOTO_PIZZA_ON_FOOT, + OBJECTIVE_GOTO_SHELTER_ON_FOOT, + OBJECTIVE_AIM_GUN_AT, OBJECTIVE_WANDER, - OBJECTIVE_WAIT_FOR_RAIN_TO_END, - OBJECTIVE_SPRINT_TO_COORD, + OBJECTIVE_WAIT_ON_FOOT_AT_SHELTER, + OBJECTIVE_SPRINT_TO_AREA, OBJECTIVE_KILL_CHAR_ON_BOAT, OBJECTIVE_SOLICIT_FOOT, - OBJECTIVE_WAIT_FOR_BUS, - OBJECTIVE_USE_ICECREAM_ATTRACTOR, - OBJECTIVE_PURCHASE_ICECREAM, + OBJECTIVE_WAIT_ON_FOOT_AT_BUS_STOP, + OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT, + OBJECTIVE_WAIT_ON_FOOT_AT_ICE_CREAM_VAN, OBJ_55, OBJ_56, OBJ_57, @@ -349,6 +349,7 @@ enum eMoveState { PEDMOVE_JOG, PEDMOVE_RUN, PEDMOVE_SPRINT, + PEDMOVE_THROWN }; class CVehicle; @@ -966,9 +967,9 @@ public: bool EnteringCar(void) { return m_nPedState == PED_ENTER_CAR || m_nPedState == PED_CARJACK; } bool HasAttractor(void) { return m_attractor != nil; } bool IsUseAttractorObjective(eObjective obj) { - return obj == OBJECTIVE_USE_ATM_ATTRACTOR || obj == OBJECTIVE_USE_ICECREAM_ATTRACTOR || - obj == OBJECTIVE_USE_PIZZA_ATTRACTOR || obj == OBJECTIVE_USE_SEAT_ATTRACTOR || - obj == OBJECTIVE_USE_SHELTER_ATTRACTOR || obj == OBJECTIVE_USE_STOP_ATTRACTOR; + return obj == OBJECTIVE_GOTO_ATM_ON_FOOT || obj == OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT || + obj == OBJECTIVE_GOTO_PIZZA_ON_FOOT || obj == OBJECTIVE_GOTO_SEAT_ON_FOOT || + obj == OBJECTIVE_GOTO_SHELTER_ON_FOOT || obj == OBJECTIVE_GOTO_BUS_STOP_ON_FOOT; } void ReplaceWeaponWhenExitingVehicle(void); @@ -1080,11 +1081,6 @@ public: static bool bPedCheat3; static CVector2D ms_vec2DFleePosition; -#ifdef TOGGLEABLE_BETA_FEATURES - static bool bPopHeadsOnHeadshot; - static bool bMakePedsRunToPhonesToReportCrimes; -#endif - #ifndef MASTER // Mobile things void DebugDrawPedDestination(CPed *, int, int); diff --git a/src/peds/PedAttractor.cpp b/src/peds/PedAttractor.cpp index 3d35b8a3..659a522b 100644 --- a/src/peds/PedAttractor.cpp +++ b/src/peds/PedAttractor.cpp @@ -276,27 +276,27 @@ static bool IsPedUsingAttractorOfThisType(int8 type, CPed* pPed) { switch (type) { case ATTRACTOR_ATM: - if (pPed->m_objective == OBJECTIVE_USE_ATM_ATTRACTOR) + if (pPed->m_objective == OBJECTIVE_GOTO_ATM_ON_FOOT) return true; break; case ATTRACTOR_SEAT: - if (pPed->m_objective == OBJECTIVE_USE_SEAT_ATTRACTOR) + if (pPed->m_objective == OBJECTIVE_GOTO_SEAT_ON_FOOT) return true; break; case ATTRACTOR_STOP: - if (pPed->m_objective == OBJECTIVE_USE_STOP_ATTRACTOR || pPed->m_objective == OBJECTIVE_WAIT_FOR_BUS || pPed->m_objective == OBJECTIVE_IDLE) + if (pPed->m_objective == OBJECTIVE_GOTO_BUS_STOP_ON_FOOT || pPed->m_objective == OBJECTIVE_WAIT_ON_FOOT_AT_BUS_STOP || pPed->m_objective == OBJECTIVE_WAIT_ON_FOOT) return true; break; case ATTRACTOR_PIZZA: - if (pPed->m_objective == OBJECTIVE_USE_PIZZA_ATTRACTOR || pPed->m_objective == OBJECTIVE_IDLE) + if (pPed->m_objective == OBJECTIVE_GOTO_PIZZA_ON_FOOT || pPed->m_objective == OBJECTIVE_WAIT_ON_FOOT) return true; break; case ATTRACTOR_SHELTER: - if (pPed->m_objective == OBJECTIVE_USE_SHELTER_ATTRACTOR || pPed->m_objective == OBJECTIVE_WAIT_FOR_RAIN_TO_END) + if (pPed->m_objective == OBJECTIVE_GOTO_SHELTER_ON_FOOT || pPed->m_objective == OBJECTIVE_WAIT_ON_FOOT_AT_SHELTER) return true; break; case ATTRACTOR_ICECREAM: - if (pPed->m_objective == OBJECTIVE_USE_ICECREAM_ATTRACTOR || pPed->m_objective == OBJECTIVE_PURCHASE_ICECREAM) + if (pPed->m_objective == OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT || pPed->m_objective == OBJECTIVE_WAIT_ON_FOOT_AT_ICE_CREAM_VAN) return true; break; } diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp index 887ebc11..35689e4e 100644 --- a/src/peds/PlayerPed.cpp +++ b/src/peds/PlayerPed.cpp @@ -1485,7 +1485,7 @@ CPlayerPed::ProcessControl(void) SetDead(); return; } - if (m_nPedState == PED_DRIVING && m_objective != OBJECTIVE_LEAVE_VEHICLE) { + if (m_nPedState == PED_DRIVING && m_objective != OBJECTIVE_LEAVE_CAR) { if (m_pMyVehicle->IsCar() && ((CAutomobile*)m_pMyVehicle)->Damage.GetDoorStatus(DOOR_FRONT_LEFT) == DOOR_STATUS_SWINGING) { CAnimBlendAssociation *rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR); if (!rollDoorAssoc) { diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp index fe459b4a..f3ea921b 100644 --- a/src/render/Hud.cpp +++ b/src/render/Hud.cpp @@ -500,7 +500,11 @@ void CHud::Draw() CFont::SetColor(WANTED_COLOR); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f + 23.0f * i), SCREEN_SCALE_Y(87.0f), sPrintIcon); - // TODO(Miami): There is one more condition in here + } else if (playerPed->m_pWanted->m_nMinWantedLevel > i && CTimer::GetFrameCounter() & 4) { + WANTED_COLOR_FLASH.a = alpha; + 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) { NOTWANTED_COLOR.a = alpha; CFont::SetColor(NOTWANTED_COLOR); diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 905a8338..925bc884 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -322,7 +322,7 @@ CAutomobile::ProcessControl(void) if(!pDriver->IsPlayer() && !(pDriver->m_leader && pDriver->m_leader->bInVehicle) && pDriver->CharCreatedBy != MISSION_CHAR) - pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this); + pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, this); } ActivateBombWhenEntered(); @@ -334,7 +334,7 @@ CAutomobile::ProcessControl(void) if(!pPassengers[i]->IsPlayer() && !(pPassengers[i]->m_leader && pPassengers[i]->m_leader->bInVehicle) && pPassengers[i]->CharCreatedBy != MISSION_CHAR) - pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this); + pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_CAR, this); } CRubbish::StirUp(this); @@ -442,7 +442,7 @@ CAutomobile::ProcessControl(void) }else if(pDriver && pDriver->IsPlayer() && (pDriver->GetPedState() == PED_ARRESTED || pDriver->GetPedState() == PED_DRAG_FROM_CAR || - (pDriver->GetPedState() == PED_EXIT_CAR || pDriver->m_objective == OBJECTIVE_LEAVE_VEHICLE) && !CanPedJumpOutCar())){ + (pDriver->GetPedState() == PED_EXIT_CAR || pDriver->m_objective == OBJECTIVE_LEAVE_CAR) && !CanPedJumpOutCar())){ bIsHandbrakeOn = true; m_fBrakePedal = 1.0f; m_fGasPedal = 0.0f; @@ -532,7 +532,7 @@ CAutomobile::ProcessControl(void) (pDriver && pDriver->IsPlayer() && (pDriver->GetPedState() == PED_ARRESTED || pDriver->GetPedState() == PED_DRAG_FROM_CAR || - (pDriver->GetPedState() == PED_EXIT_CAR || pDriver->m_objective == OBJECTIVE_LEAVE_VEHICLE) && !CanPedJumpOutCar()))){ + (pDriver->GetPedState() == PED_EXIT_CAR || pDriver->m_objective == OBJECTIVE_LEAVE_CAR) && !CanPedJumpOutCar()))){ bIsHandbrakeOn = true; m_fBrakePedal = 1.0f; m_fGasPedal = 0.0f; diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index 2c770834..360b843b 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -1228,7 +1228,7 @@ CVehicle::InflictDamage(CEntity *damagedBy, eWeaponType weaponType, float damage if(AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_PLOUGH_THROUGH || CGeneral::GetRandomNumberInRange(0.0f, 1.0f) > 0.5f && AutoPilot.m_nCarMission == MISSION_CRUISE){ // Drive away like a maniac - if(pDriver && pDriver->m_objective != OBJECTIVE_LEAVE_VEHICLE){ + if(pDriver && pDriver->m_objective != OBJECTIVE_LEAVE_CAR){ if(AutoPilot.m_nDrivingStyle != DRIVINGSTYLE_PLOUGH_THROUGH) AutoPilot.m_nCruiseSpeed *= 1.5f; AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_PLOUGH_THROUGH; @@ -1238,16 +1238,16 @@ CVehicle::InflictDamage(CEntity *damagedBy, eWeaponType weaponType, float damage if (pDriver && pDriver->CharCreatedBy != MISSION_CHAR) { SetStatus(STATUS_ABANDONED); pDriver->bFleeAfterExitingCar = true; - pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this); + pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, this); pDriver->Say(SOUND_PED_FLEE_SPRINT); } int time = 200; for (int i = 0; i < m_nNumMaxPassengers; i++) { if (pPassengers[i] && - pPassengers[i]->m_objective != OBJECTIVE_LEAVE_VEHICLE && + pPassengers[i]->m_objective != OBJECTIVE_LEAVE_CAR && pPassengers[i]->CharCreatedBy != MISSION_CHAR) { pPassengers[i]->bFleeAfterExitingCar = true; - pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this); + pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_CAR, this); pPassengers[i]->m_objectiveTimer = CTimer::GetTimeInMilliseconds() + time; pPassengers[i]->Say(SOUND_PED_FLEE_SPRINT); time += 200; @@ -1504,7 +1504,7 @@ CVehicle::MakeNonDraggedPedsLeaveVehicle(CPed *ped1, CPed *ped2, CPlayerPed *&pl int time = 1800; for(i = 0; i < numPeds3; i++){ peds3[i]->m_leaveCarTimer = CTimer::GetTimeInMilliseconds() + time; - peds3[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this); + peds3[i]->SetObjective(OBJECTIVE_LEAVE_CAR, this); time += CGeneral::GetRandomNumberInRange(300.0f, 600.0f); } diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index a895315e..8e7e4265 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -740,7 +740,7 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource) { if (driver->m_pedStats->m_temper <= driver->m_pedStats->m_fear) { - driver->SetObjective(OBJECTIVE_FLEE_TILL_SAFE); + driver->SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE); } else { @@ -756,7 +756,7 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource) CPed *passenger = nearCar->pPassengers[j]; if (passenger && passenger->CharCreatedBy != MISSION_CHAR) { - nearCar->pPassengers[j]->SetObjective(OBJECTIVE_FLEE_TILL_SAFE); + nearCar->pPassengers[j]->SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE); passenger->m_leaveCarTimer = CTimer::GetTimeInMilliseconds() + leaveCarDelay; leaveCarDelay += 200; } @@ -767,8 +767,8 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource) CPed *driver = nearCar->pDriver; if (driver) { - if (driver->m_objective != OBJECTIVE_LEAVE_VEHICLE && driver->m_objective != OBJECTIVE_KILL_CHAR_ON_FOOT && - driver->m_objective != OBJECTIVE_FLEE_TILL_SAFE) + if (driver->m_objective != OBJECTIVE_LEAVE_CAR && driver->m_objective != OBJECTIVE_KILL_CHAR_ON_FOOT && + driver->m_objective != OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE) { if (nearCar->AutoPilot.m_nDrivingStyle != DRIVINGSTYLE_PLOUGH_THROUGH) nearCar->AutoPilot.m_nCruiseSpeed = nearCar->AutoPilot.m_nCruiseSpeed * 1.5f; |