summaryrefslogtreecommitdiffstats
path: root/src/peds/CopPed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds/CopPed.cpp')
-rw-r--r--src/peds/CopPed.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp
index 10490a69..33b44d3e 100644
--- a/src/peds/CopPed.cpp
+++ b/src/peds/CopPed.cpp
@@ -96,9 +96,7 @@ CCopPed::CCopPed(eCopType copType, int32 modifier) : CPed(PEDTYPE_COP)
field_61C = 0;
field_624 = 0;
m_pStinger = new CStinger;
- if (m_pPointGunAt)
- m_pPointGunAt->CleanUpOldReference(&m_pPointGunAt);
- m_pPointGunAt = nil;
+ SetWeaponLockOnTarget(nil);
}
CCopPed::~CCopPed()
@@ -493,12 +491,7 @@ CCopPed::CopAI(void)
false, true, false, false, true, false, false)
|| foundEnt && foundEnt == playerOrHisVeh) {
- if (m_pPointGunAt)
- m_pPointGunAt->CleanUpOldReference((CEntity**) &m_pPointGunAt);
- m_pPointGunAt = playerOrHisVeh;
- if (playerOrHisVeh)
- playerOrHisVeh->RegisterReference((CEntity**) &m_pPointGunAt);
-
+ SetWeaponLockOnTarget(playerOrHisVeh);
SetAttack(playerOrHisVeh);
SetShootTimer(CGeneral::GetRandomNumberInRange(500, 1000));
}
@@ -880,4 +873,4 @@ CCopPed::ProcessStingerCop(void)
} else {
ClearPursuit();
}
-} \ No newline at end of file
+}