From b8cc36dfd19913b731304b95a67d993e2624471e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 22 Apr 2016 22:28:00 +0100 Subject: [PATCH] P_LookForEnemies should not change the player's angle until the target has been decided This fixes a quirk with Shadow with chaos control sometimes throwing the player in the wrong direction --- src/p_user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 72d99d6d..65ba0bc6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7512,8 +7512,6 @@ boolean P_LookForEnemies(player_t *player) if (an > ANGLE_90 && an < ANGLE_270) continue; // behind back - player->mo->angle = R_PointToAngle2(player->mo->x, player->mo->y, mo->x, mo->y); - if (!P_CheckSight(player->mo, mo)) continue; // out of sight @@ -7524,6 +7522,7 @@ boolean P_LookForEnemies(player_t *player) { // Found a target monster P_SetTarget(&player->mo->target, P_SetTarget(&player->mo->tracer, closestmo)); + player->mo->angle = R_PointToAngle2(player->mo->x, player->mo->y, closestmo->x, closestmo->y); return true; }