Skip to content

Commit 7bbb2ad

Browse files
committed
Made move proximity use actual distance
1 parent 81a8361 commit 7bbb2ad

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Entities/Actor.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void Actor::Clear() {
125125
m_MoveVector.Reset();
126126
m_MovePath.clear();
127127
m_UpdateMovePath = true;
128-
m_MoveProximityLimit = 100.0F;
128+
m_MoveProximityLimit = 75.0F;
129129
m_AIBaseDigStrength = c_PathFindingDefaultDigStrength;
130130
m_BaseMass = std::numeric_limits<float>::infinity();
131131

@@ -1338,15 +1338,15 @@ void Actor::Update()
13381338
{
13391339
pathPointVec = g_SceneMan.ShortestDistance(m_Pos, *lItr);
13401340
// Make sure we are within range AND have a clear sight to the path point we're about to eliminate, or it might be around a corner
1341-
if (pathPointVec.GetLargest() <= m_MoveProximityLimit && !g_SceneMan.CastStrengthRay(m_Pos, pathPointVec, 5, notUsed, 0))
1341+
if (pathPointVec.MagnitudeIsLessThan(m_MoveProximityLimit) && !g_SceneMan.CastStrengthRay(m_Pos, pathPointVec, 5, notUsed, 0))
13421342
{
13431343
lItr++;
13441344
// Save the last one before being popped off so we can use it to check if we need to dig (if there's any material between last and current)
13451345
m_PrevPathTarget = m_MovePath.front();
13461346
m_MovePath.pop_front();
1347-
}
1348-
else
1347+
} else {
13491348
break;
1349+
}
13501350
}
13511351

13521352
if (!m_MovePath.empty())
@@ -1356,8 +1356,9 @@ void Actor::Update()
13561356
// See if we are close enough to the last point in the current path, in which case we can toss teh whole current path and start ont he next
13571357
pathPointVec = g_SceneMan.ShortestDistance(m_Pos, m_MovePath.back());
13581358
// Clear out the current path, the player apparently took a shortcut
1359-
if (pathPointVec.GetLargest() <= m_MoveProximityLimit && !g_SceneMan.CastStrengthRay(m_Pos, pathPointVec, 5, notUsed, 0, g_MaterialDoor))
1359+
if (pathPointVec.MagnitudeIsLessThan(m_MoveProximityLimit) && !g_SceneMan.CastStrengthRay(m_Pos, pathPointVec, 5, notUsed, 0, g_MaterialDoor)) {
13601360
m_MovePath.clear();
1361+
}
13611362
}
13621363

13631364
// If still stuff in the path, get the next point on it

0 commit comments

Comments
 (0)