summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2020-12-12 18:39:34 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2020-12-12 18:39:34 +0100
commitb3f97cdce46cb703c79b3396fb54616b2b8baa22 (patch)
tree598e3603f50ea666383b48839bcb270a8047f7ba /src/peds
parentfixed a bug (diff)
downloadre3-b3f97cdce46cb703c79b3396fb54616b2b8baa22.tar
re3-b3f97cdce46cb703c79b3396fb54616b2b8baa22.tar.gz
re3-b3f97cdce46cb703c79b3396fb54616b2b8baa22.tar.bz2
re3-b3f97cdce46cb703c79b3396fb54616b2b8baa22.tar.lz
re3-b3f97cdce46cb703c79b3396fb54616b2b8baa22.tar.xz
re3-b3f97cdce46cb703c79b3396fb54616b2b8baa22.tar.zst
re3-b3f97cdce46cb703c79b3396fb54616b2b8baa22.zip
Diffstat (limited to '')
-rw-r--r--src/peds/PedAI.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp
index fc8472d6..23119a59 100644
--- a/src/peds/PedAI.cpp
+++ b/src/peds/PedAI.cpp
@@ -1334,14 +1334,14 @@ CPed::ProcessObjective(void)
// I hope so
CVector ourHead = GetMatrix() * CVector(0.5f, 0.0f, 0.6f);
CVector maxShotPos = m_carInObjective->GetPosition() - ourHead;
- maxShotPos.Normalise();
- maxShotPos = maxShotPos * wepInfo->m_fRange + ourHead;
+ maxShotPos *= wepInfo->m_fRange / maxShotPos.Magnitude();
+ maxShotPos += ourHead;
- CWorld::bIncludeDeadPeds = true;
CColPoint foundCol;
CEntity *foundEnt;
- CWorld::ProcessLineOfSight(ourHead, maxShotPos, foundCol, foundEnt,
- true, true, true, true, false, true, false);
+
+ CWorld::bIncludeDeadPeds = true;
+ CWorld::ProcessLineOfSight(ourHead, maxShotPos, foundCol, foundEnt, true, true, true, true, false, true, false);
CWorld::bIncludeDeadPeds = false;
if (foundEnt == m_carInObjective) {
SetAttack(m_carInObjective);