Don't let the last player walk back out of the exit

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-24 10:18:45 -07:00
parent a0b34217b4
commit 86bf90ee89

View File

@ -1044,8 +1044,10 @@ export class Level extends LevelInterface {
// If the game has already been won (or lost), don't bother with a move; it'll misalign the // If the game has already been won (or lost), don't bother with a move; it'll misalign the
// player from their actual position and not accomplish anything gameplay-wise. // player from their actual position and not accomplish anything gameplay-wise.
// (Note this is only necessary because our update order is inverted from CC2.) // (Note this is only necessary because our update order is inverted from CC2, and because
if (this.state !== 'playing') // we don't erase the last player when they exit.)
// TODO might not be good enough if something else tries to step on us later this tic!
if (this.state !== 'playing' || this.remaining_players <= 0)
return null; return null;
// TODO player in a cloner can't move (but player in a trap can still turn) // TODO player in a cloner can't move (but player in a trap can still turn)