Skip to content

Commit

Permalink
Don't skip characters if the active one dies
Browse files Browse the repository at this point in the history
  • Loading branch information
lorgan3 committed Jan 27, 2024
1 parent b5a7db9 commit f020306
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/data/network/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export class Player {
}

removeCharacter(character: Character) {
if (character === this.activeCharacter) {
this.active--;
}

const index = this.characters.indexOf(character);
if (this.active >= this.characters.length) {
this.active = -1;
Expand Down

0 comments on commit f020306

Please sign in to comment.