diff options
Diffstat (limited to 'src/peds')
-rw-r--r-- | src/peds/CivilianPed.cpp | 6 | ||||
-rw-r--r-- | src/peds/CopPed.cpp | 28 | ||||
-rw-r--r-- | src/peds/CopPed.h | 4 | ||||
-rw-r--r-- | src/peds/Ped.cpp | 12 | ||||
-rw-r--r-- | src/peds/PedType.h | 4 |
5 files changed, 23 insertions, 31 deletions
diff --git a/src/peds/CivilianPed.cpp b/src/peds/CivilianPed.cpp index ae30fdfe..2be45ba9 100644 --- a/src/peds/CivilianPed.cpp +++ b/src/peds/CivilianPed.cpp @@ -18,7 +18,8 @@ #include <float.h> #endif -// --MIAMI: Done +// --MIAMI: file done except TODOs + CCivilianPed::CCivilianPed(ePedType pedtype, uint32 mi) : CPed(pedtype) { SetModelIndex(mi); @@ -43,7 +44,6 @@ CCivilianPed::CCivilianPed(ePedType pedtype, uint32 mi) : CPed(pedtype) m_bAttractorUnk = (CGeneral::GetRandomNumberInRange(0.0f, 1.0f) < 1.25f); } -// --MIAMI: Done void CCivilianPed::CivilianAI(void) { @@ -221,7 +221,6 @@ CCivilianPed::CivilianAI(void) } } -// --MIAMI: Done except comments void CCivilianPed::ProcessControl(void) { @@ -504,7 +503,6 @@ bool CCivilianPed::IsAttractedTo(int8 type) return false; } -// --MIAMI: Done void CCivilianPed::EnterVacantNearbyCars(void) { diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp index 9160319b..10490a69 100644 --- a/src/peds/CopPed.cpp +++ b/src/peds/CopPed.cpp @@ -20,6 +20,8 @@ #include "Ropes.h" #include "Stinger.h" +// --MIAMI: file done except TODOs + CCopPed::CCopPed(eCopType copType, int32 modifier) : CPed(PEDTYPE_COP) { m_nCopType = copType; @@ -83,10 +85,10 @@ CCopPed::CCopPed(eCopType copType, int32 modifier) : CPed(PEDTYPE_COP) m_attackTimer = 0; m_bBeatingSuspect = false; m_bStopAndShootDisabledZone = false; - field_601 = false; + m_bDragsPlayerFromCar = false; m_bZoneDisabled = false; field_628 = -1; - m_nRoadblockNode = -1; // TODO(Miami): this will be nil + m_nRoadblockVeh = nil; m_bThrowsSpikeTrap = false; m_pRopeEntity = nil; m_fAbseilPos = 0.0f; @@ -106,7 +108,6 @@ CCopPed::~CCopPed() delete m_pStinger; } -// --MIAMI: Done // Parameter should always be CPlayerPed, but it seems they considered making civilians arrestable at some point void CCopPed::SetArrestPlayer(CPed *player) @@ -155,7 +156,6 @@ CCopPed::SetArrestPlayer(CPed *player) SetCurrentWeapon(WEAPONTYPE_COLT45); } -// --MIAMI: Done void CCopPed::ClearPursuit(void) { @@ -194,7 +194,7 @@ CCopPed::ClearPursuit(void) bNotAllowedToDuck = false; bKindaStayInSamePlace = false; m_bStopAndShootDisabledZone = false; - field_601 = false; + m_bDragsPlayerFromCar = false; m_bZoneDisabled = false; ClearObjective(); if (IsPedInControl()) { @@ -212,7 +212,6 @@ CCopPed::ClearPursuit(void) } } -// --MIAMI: Done // TODO: I don't know why they needed that parameter. void CCopPed::SetPursuit(bool ignoreCopLimit) @@ -245,7 +244,6 @@ CCopPed::SetPursuit(bool ignoreCopLimit) } } -// --MIAMI: Done void CCopPed::ArrestPlayer(void) { @@ -311,7 +309,6 @@ CCopPed::ScanForCrimes(void) } } -// --MIAMI: Done void CCopPed::CopAI(void) { @@ -465,17 +462,13 @@ CCopPed::CopAI(void) bNotAllowedToDuck = false; bDuckAndCover = false; } else { - // TODO(Miami): Roadblock system is still III float dotProd; - if (m_nRoadblockNode != -1) { - CPathNode *roadBlockNode = &ThePaths.m_pathNodes[CRoadBlocks::RoadBlockNodes[m_nRoadblockNode]]; - dotProd = DotProduct2D(playerOrHisVeh->GetPosition() - roadBlockNode->GetPosition(), GetPosition() - roadBlockNode->GetPosition()); + if (m_nRoadblockVeh) { + dotProd = DotProduct2D(playerOrHisVeh->GetPosition() - m_nRoadblockVeh->GetPosition(), GetPosition() - m_nRoadblockVeh->GetPosition()); } else dotProd = -1.0f; - if(dotProd >= 0.0f) { - bIsPointingGunAt = true; - } else { + if(dotProd < 0.0f) { if (bIsDucking) ClearDuck(); m_bIsDisabledCop = false; @@ -484,6 +477,8 @@ CCopPed::CopAI(void) bCrouchWhenShooting = false; bDuckAndCover = false; SetPursuit(false); + } else { + bIsPointingGunAt = true; } } } @@ -601,7 +596,6 @@ CCopPed::CopAI(void) } } -// --MIAMI: Done void CCopPed::ProcessControl(void) { @@ -822,7 +816,6 @@ CCopPed::ProcessControl(void) field_624 = 0; } -// --MIAMI: Done void CCopPed::ProcessHeliSwat(void) { @@ -858,7 +851,6 @@ CCopPed::ProcessHeliSwat(void) } } -// --MIAMI: Done void CCopPed::ProcessStingerCop(void) { diff --git a/src/peds/CopPed.h b/src/peds/CopPed.h index 190d619e..06fe54b0 100644 --- a/src/peds/CopPed.h +++ b/src/peds/CopPed.h @@ -14,14 +14,14 @@ enum eCopType class CCopPed : public CPed { public: - int16 m_nRoadblockNode; + CVehicle* m_nRoadblockVeh; float m_fDistanceToTarget; bool m_bIsInPursuit; bool m_bIsDisabledCop; int8 field_5FE; bool m_bBeatingSuspect; bool m_bStopAndShootDisabledZone; - bool field_601; // set when police dragging player from car + bool m_bDragsPlayerFromCar; bool m_bZoneDisabled; float m_fAbseilPos; eCopType m_nCopType; diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 6b704b37..a7c82f0a 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -67,6 +67,8 @@ #include "CutsceneShadow.h" #include "Clock.h" +// --MIAMI: file done except TODOs + #define CAN_SEE_ENTITY_ANGLE_THRESHOLD DEGTORAD(60.0f) CPed *gapTempPedList[50]; @@ -10945,7 +10947,7 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg) pedToDragOut->RegisterThreatWithGangPeds(ped); if (ped->m_nPedType == PEDTYPE_COP && pedToDragOut == FindPlayerPed() && veh->IsBike()) - ((CCopPed*)ped)->field_601 = 1; + ((CCopPed*)ped)->m_bDragsPlayerFromCar = 1; if (pedToDragOut == veh->pDriver) { if (veh->pPassengers[0]) @@ -20894,11 +20896,11 @@ CPed::KillCharOnFootMelee(CVector &ourPos, CVector &targetPos, CVector &distWith } if (m_nPedType == PEDTYPE_COP && m_pedInObjective->IsPlayer()) { float maxArrestDist = 1.5f; - if (((CCopPed*)this)->field_601) { + if (((CCopPed*)this)->m_bDragsPlayerFromCar) { if (m_nPedState == PED_FALL) { maxArrestDist = 3.5f; } else if (m_nPedState != PED_DRAG_FROM_CAR) { - ((CCopPed*)this)->field_601 = 0; + ((CCopPed*)this)->m_bDragsPlayerFromCar = 0; } } @@ -21139,11 +21141,11 @@ CPed::KillCharOnFootArmed(CVector &ourPos, CVector &targetPos, CVector &distWith } if (m_nPedType == PEDTYPE_COP && m_pedInObjective->IsPlayer()) { float maxArrestDist = 1.5f; - if (((CCopPed*)this)->field_601) { + if (((CCopPed*)this)->m_bDragsPlayerFromCar) { if (m_nPedState == PED_FALL) { maxArrestDist = 3.5f; } else if (m_nPedState != PED_DRAG_FROM_CAR) { - ((CCopPed*)this)->field_601 = 0; + ((CCopPed*)this)->m_bDragsPlayerFromCar = 0; } } diff --git a/src/peds/PedType.h b/src/peds/PedType.h index 3c87c866..e2eafb4f 100644 --- a/src/peds/PedType.h +++ b/src/peds/PedType.h @@ -14,9 +14,9 @@ enum ePedType PEDTYPE_GANG2, PEDTYPE_GANG3, PEDTYPE_GANG4, - PEDTYPE_GANG5, + PEDTYPE_GANG5, // Security - hardcoded PEDTYPE_GANG6, - PEDTYPE_GANG7, // Vercetti gang + PEDTYPE_GANG7, // Vercetti gang - hardcoded PEDTYPE_GANG8, PEDTYPE_GANG9, PEDTYPE_EMERGENCY, |