From f020306c9f9afe56ea941b84b1980d6a655995d7 Mon Sep 17 00:00:00 2001 From: Lennert Claeys Date: Sat, 27 Jan 2024 18:50:39 +0100 Subject: [PATCH] Don't skip characters if the active one dies --- src/data/network/player.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/data/network/player.ts b/src/data/network/player.ts index 0d1e8d2..e94eb2f 100644 --- a/src/data/network/player.ts +++ b/src/data/network/player.ts @@ -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;