summaryrefslogtreecommitdiffstats
path: root/src/peds/PedAI.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-12-14 08:47:07 +0100
committerSergeanur <s.anureev@yandex.ua>2020-12-14 08:47:07 +0100
commitf42a01f653c860b5df3cfdbe34cc37f25dc3c36a (patch)
treebc6a09f0a1ca0fafbf1e53b4c8e60b581281c0c4 /src/peds/PedAI.cpp
parentMerge branch 'master' of https://github.com/GTAmodding/re3 (diff)
downloadre3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar.gz
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar.bz2
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar.lz
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar.xz
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar.zst
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.zip
Diffstat (limited to 'src/peds/PedAI.cpp')
-rw-r--r--src/peds/PedAI.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp
index f1d16119..5eaf8cd8 100644
--- a/src/peds/PedAI.cpp
+++ b/src/peds/PedAI.cpp
@@ -620,9 +620,7 @@ CPed::UpdateFromLeader(void)
m_pLookTarget->RegisterReference((CEntity **) &m_pLookTarget);
TurnBody();
if (m_attackTimer < CTimer::GetTimeInMilliseconds() && !GetWeapon()->IsTypeMelee()) {
- m_pPointGunAt = m_threatEntity;
- if (m_threatEntity)
- m_threatEntity->RegisterReference((CEntity **) &m_pPointGunAt);
+ SetWeaponLockOnTarget(m_threatEntity);
SetAttack(m_threatEntity);
}
}
@@ -1026,10 +1024,7 @@ CPed::ProcessObjective(void)
CWorld::bIncludeDeadPeds = false;
if (foundEnt == vehOfTarget) {
SetAttack(vehOfTarget);
- m_pPointGunAt = vehOfTarget;
- if (vehOfTarget)
- vehOfTarget->RegisterReference((CEntity **) &m_pPointGunAt);
-
+ SetWeaponLockOnTarget(vehOfTarget);
SetShootTimer(CGeneral::GetRandomNumberInRange(500, 2000));
if (distWithTargetSc <= m_distanceToCountSeekDone) {
SetAttackTimer(CGeneral::GetRandomNumberInRange(200, 500));
@@ -1162,10 +1157,7 @@ CPed::ProcessObjective(void)
CWorld::bIncludeDeadPeds = false;
if (foundEnt == m_pedInObjective) {
SetAttack(m_pedInObjective);
- m_pPointGunAt = m_pedInObjective;
- if (m_pedInObjective)
- m_pedInObjective->RegisterReference((CEntity **) &m_pPointGunAt);
-
+ SetWeaponLockOnTarget(m_pedInObjective);
SetShootTimer(CGeneral::GetRandomNumberInRange(500.0f, 2000.0f));
int time;
@@ -1551,10 +1543,7 @@ CPed::ProcessObjective(void)
CWorld::bIncludeDeadPeds = false;
if (foundEnt == m_carInObjective) {
SetAttack(m_carInObjective);
- m_pPointGunAt = m_carInObjective;
- if (m_pPointGunAt)
- m_pPointGunAt->RegisterReference((CEntity **) &m_pPointGunAt);
-
+ SetWeaponLockOnTarget(m_carInObjective);
SetShootTimer(CGeneral::GetRandomNumberInRange(500, 2000));
if (distWithTargetSc > 10.0f && !bKindaStayInSamePlace) {
SetAttackTimer(CGeneral::GetRandomNumberInRange(2000, 5000));