Fixed infinite spectator switch loop

This commit is contained in:
smallmodel 2023-11-13 20:31:41 +01:00
parent f73e4b6f22
commit c0a50eb2ff
No known key found for this signature in database
GPG key ID: A96F163ED4891440

View file

@ -4652,7 +4652,7 @@ void Player::Think(void)
if (!ent->inuse || !ent->entity) {
// Invalid spectate entity
SetPlayerSpectateRandom();
} else if (ent->entity->deadflag >= DEAD_DEAD || static_cast<Player *>(ent->entity)->IsSpectator() || IsValidSpectatePlayer(static_cast<Player *>(ent->entity))) {
} else if (ent->entity->deadflag >= DEAD_DEAD || static_cast<Player *>(ent->entity)->IsSpectator() || !IsValidSpectatePlayer(static_cast<Player *>(ent->entity))) {
SetPlayerSpectateRandom();
} else if (g_gametype->integer >= GT_TEAM && GetTeam() > TEAM_FREEFORALL && static_cast<Player*>(ent->entity)->GetTeam() != GetTeam()) {
SetPlayerSpectateRandom();