From a07e10218ee1b8635883d191e17bdd4e193a926a Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Sat, 24 Oct 2020 20:32:22 -0600 Subject: [PATCH] Monsters always attempt their last candidate direction, even if blocked --- js/game.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/game.js b/js/game.js index 9d83d11..69c17e4 100644 --- a/js/game.js +++ b/js/game.js @@ -617,6 +617,12 @@ export class Level { break; } } + + // If all the decisions are blocked, actors still try the last one (and might even + // be able to move that way by the time their turn comes around!) + if (actor.decision === null) { + actor.decision = direction_preference[direction_preference.length - 1]; + } } }