P_SupermanLook4Players: Do not allow focusing on respawning players

This commit is contained in:
toaster 2023-10-31 20:15:23 +00:00
parent 0bf9ad85c1
commit c202b603da

View file

@ -4661,22 +4661,29 @@ boolean P_BossTargetPlayer(mobj_t *actor, boolean closest)
// Finds the player no matter what they're hiding behind (even lead!) // Finds the player no matter what they're hiding behind (even lead!)
boolean P_SupermanLook4Players(mobj_t *actor) boolean P_SupermanLook4Players(mobj_t *actor)
{ {
INT32 c, stop = 0; UINT8 c, stop = 0;
player_t *playersinthegame[MAXPLAYERS]; UINT8 playersinthegame[MAXPLAYERS];
for (c = 0; c < MAXPLAYERS; c++) for (c = 0; c < MAXPLAYERS; c++)
{ {
if (playeringame[c] && !players[c].spectator) // Playing status
{ if (!playeringame[c])
if (!players[c].mo) continue;
continue; if (players[c].spectator)
continue;
if (players[c].mo->health <= 0) // Mobj status
continue; // dead if (!players[c].mo)
continue;
if (players[c].mo->health <= 0)
continue; // dead
playersinthegame[stop] = &players[c]; // Pain status
stop++; if (players[c].respawn.state != RESPAWNST_NONE)
} continue; // don't wail on the respawning
playersinthegame[stop] = c;
stop++;
} }
if (!stop) if (!stop)