Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
fix: spectating loop
Browse files Browse the repository at this point in the history
  • Loading branch information
leia-uwu committed Oct 22, 2024
1 parent 89c4005 commit 15c30fd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/src/game/objects/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1659,9 +1659,10 @@ export class Player extends BaseGameObject {
player = this;
} else if (this.spectating.dead) {
// was spectating someone but they died so find new player to spectate
player = this.spectating.killedBy
? this.spectating.killedBy
: playerBarn.randomPlayer();
player =
this.spectating.killedBy && !this.spectating.killedBy.dead
? this.spectating.killedBy
: playerBarn.randomPlayer();
if (player === this) {
player = playerBarn.randomPlayer();
}
Expand Down

0 comments on commit 15c30fd

Please sign in to comment.