mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-26 22:44:30 -04:00
Prevent P_LookForPlayers from retrying sighting a player who failed (#528)
Mitigates the poor performance in Necromantic Thirst MAP25.
From Eternity Engine: 857826ba3e
This commit is contained in:
parent
4a057a6deb
commit
6db48e1506
@ -816,6 +816,7 @@ static boolean P_LookForPlayers(mobj_t *actor, boolean allaround)
|
|||||||
{
|
{
|
||||||
player_t *player;
|
player_t *player;
|
||||||
int stop, stopc, c;
|
int stop, stopc, c;
|
||||||
|
boolean unseen[MAXPLAYERS] = {0};
|
||||||
|
|
||||||
if (actor->flags & MF_FRIEND)
|
if (actor->flags & MF_FRIEND)
|
||||||
{ // killough 9/9/98: friendly monsters go about players differently
|
{ // killough 9/9/98: friendly monsters go about players differently
|
||||||
@ -891,8 +892,11 @@ static boolean P_LookForPlayers(mobj_t *actor, boolean allaround)
|
|||||||
if (player->health <= 0)
|
if (player->health <= 0)
|
||||||
continue; // dead
|
continue; // dead
|
||||||
|
|
||||||
if (!P_IsVisible(actor, player->mo, allaround))
|
if (unseen[actor->lastlook] || !P_IsVisible(actor, player->mo, allaround))
|
||||||
|
{
|
||||||
|
unseen[actor->lastlook] = true;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
P_SetTarget(&actor->target, player->mo);
|
P_SetTarget(&actor->target, player->mo);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user