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
This commit is contained in:
Monster Iestyn 2016-04-22 22:28:00 +01:00
parent d53801c85c
commit b8cc36dfd1
1 changed files with 1 additions and 2 deletions

View File

@ -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;
}