Skip to content

Commit bcec9e5

Browse files
committed
Always update enemy direction when moving to player.
1 parent 60a0712 commit bcec9e5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

OpenTESArena/src/Entities/EntityChunkManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,8 @@ void EntityChunkManager::updateEnemyBehaviors(double dt, const WorldDouble2 &pla
12701270
}
12711271
else if (prevEnemyBehaviorStateType == EntityEnemyBehaviorStateType::MovingToPlayer)
12721272
{
1273+
entityDir = dirToPlayer;
1274+
12731275
const JPH::BodyID &physicsBodyID = entityInst.physicsBodyID;
12741276
DebugAssert(!physicsBodyID.IsInvalid());
12751277

@@ -1283,8 +1285,6 @@ void EntityChunkManager::updateEnemyBehaviors(double dt, const WorldDouble2 &pla
12831285

12841286
if (!isCloseEnoughToAttackPlayer)
12851287
{
1286-
entityDir = dirToPlayer;
1287-
12881288
constexpr double entityMoveSpeed = 1.50;
12891289
const Double2 entityVelocity = entityDir * entityMoveSpeed;
12901290

0 commit comments

Comments
 (0)