diff options
Diffstat (limited to 'src/peds/CopPed.cpp')
-rw-r--r-- | src/peds/CopPed.cpp | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp index 99e8c1ae..1affb64d 100644 --- a/src/peds/CopPed.cpp +++ b/src/peds/CopPed.cpp @@ -17,13 +17,14 @@ #include "Renderer.h" #include "Camera.h" -CCopPed::CCopPed(eCopType copType) : CPed(PEDTYPE_COP) +CCopPed::CCopPed(eCopType copType, int32 modifier) : CPed(PEDTYPE_COP) { m_nCopType = copType; switch (copType) { case COP_STREET: SetModelIndex(MI_COP); - GiveWeapon(WEAPONTYPE_COLT45, 1000); + // GiveWeapon(WEAPONTYPE_NIGHTSTICK, 1000, true); // TODO(Miami) + GiveDelayedWeapon(WEAPONTYPE_COLT45, 1000); m_currentWeapon = WEAPONTYPE_UNARMED; m_fArmour = 0.0f; m_wepSkills = 208; /* TODO: what is this? seems unused */ @@ -31,17 +32,15 @@ CCopPed::CCopPed(eCopType copType) : CPed(PEDTYPE_COP) break; case COP_FBI: SetModelIndex(MI_FBI); - GiveWeapon(WEAPONTYPE_COLT45, 1000); - GiveWeapon(WEAPONTYPE_AK47, 1000); - SetCurrentWeapon(WEAPONTYPE_AK47); + GiveDelayedWeapon(WEAPONTYPE_MP5, 1000); + SetCurrentWeapon(WEAPONTYPE_MP5); m_fArmour = 100.0f; m_wepSkills = 176; /* TODO: what is this? seems unused */ m_wepAccuracy = 76; break; case COP_SWAT: SetModelIndex(MI_SWAT); - GiveWeapon(WEAPONTYPE_COLT45, 1000); - GiveWeapon(WEAPONTYPE_UZI, 1000); + GiveDelayedWeapon(WEAPONTYPE_UZI, 1000); SetCurrentWeapon(WEAPONTYPE_UZI); m_fArmour = 50.0f; m_wepSkills = 32; /* TODO: what is this? seems unused */ @@ -49,15 +48,29 @@ CCopPed::CCopPed(eCopType copType) : CPed(PEDTYPE_COP) break; case COP_ARMY: SetModelIndex(MI_ARMY); - GiveWeapon(WEAPONTYPE_COLT45, 1000); - GiveWeapon(WEAPONTYPE_M16, 1000); - GiveWeapon(WEAPONTYPE_GRENADE, 10); - SetCurrentWeapon(WEAPONTYPE_M16); + GiveDelayedWeapon(WEAPONTYPE_MP5, 1000); + SetCurrentWeapon(WEAPONTYPE_MP5); m_fArmour = 100.0f; m_wepSkills = 32; /* TODO: what is this? seems unused */ m_wepAccuracy = 84; break; - default: + case COP_MIAMIVICE: + switch (modifier) { + case 0: SetModelIndex(MI_VICE1); break; + case 1: SetModelIndex(MI_VICE2); break; + case 2: SetModelIndex(MI_VICE3); break; + case 3: SetModelIndex(MI_VICE4); break; + case 4: SetModelIndex(MI_VICE5); break; + case 5: SetModelIndex(MI_VICE6); break; + case 6: SetModelIndex(MI_VICE7); break; + case 7: SetModelIndex(MI_VICE8); break; + default: assert(0); break; + } + GiveDelayedWeapon(WEAPONTYPE_UZI, 1000); + SetCurrentWeapon(WEAPONTYPE_UZI); + m_fArmour = 100.0f; + m_wepSkills = 176; + m_wepAccuracy = 76; break; } m_bIsInPursuit = false; @@ -425,8 +438,9 @@ CCopPed::CopAI(void) #ifdef VC_PED_PORTS float dotProd; if (m_nRoadblockNode != -1) { - CTreadable *roadBlockRoad = ThePaths.m_mapObjects[CRoadBlocks::RoadBlockObjects[m_nRoadblockNode]]; - dotProd = DotProduct2D(playerOrHisVeh->GetPosition() - roadBlockRoad->GetPosition(), GetPosition() - roadBlockRoad->GetPosition()); + // TODO(MIAMI): check this, i'm only getting this compile here.... + CPathNode *roadBlockNode = &ThePaths.m_pathNodes[CRoadBlocks::RoadBlockNodes[m_nRoadblockNode]]; + dotProd = DotProduct2D(playerOrHisVeh->GetPosition() - roadBlockNode->GetPosition(), GetPosition() - roadBlockNode->GetPosition()); } else dotProd = -1.0f; @@ -559,9 +573,6 @@ CCopPed::CopAI(void) void CCopPed::ProcessControl(void) { - if (m_nZoneLevel > LEVEL_NONE && m_nZoneLevel != CCollision::ms_collisionInMemory) - return; - CPed::ProcessControl(); if (bWasPostponed) return; @@ -709,7 +720,7 @@ CCopPed::ProcessControl(void) return; bool dontShoot = false; - if (GetIsOnScreen() && CRenderer::IsEntityCullZoneVisible(this)) { + if (GetIsOnScreen()) { if (((CTimer::GetFrameCounter() + m_randomSeed) & 0x1F) == 17) { CEntity *foundBuilding = nil; CColPoint foundCol; |