diff --git a/js/game.js b/js/game.js index 443ba6c..eb873c0 100644 --- a/js/game.js +++ b/js/game.js @@ -966,6 +966,11 @@ export class Level { return; let all_blocked = true; for (let [i, direction] of direction_preference.entries()) { + if (direction === null) { + // This actor is giving up! Alas. + actor.decision = direction; + break; + } if (typeof direction === 'function') { // Lazy direction calculation (used for walkers) direction = direction(); diff --git a/js/tiletypes.js b/js/tiletypes.js index 58dc24a..54dd48c 100644 --- a/js/tiletypes.js +++ b/js/tiletypes.js @@ -1861,12 +1861,7 @@ const TILE_TYPES = { }, movement_speed: 4, decide_movement(me, level) { - if (level.yellow_tank_decision) { - return [level.yellow_tank_decision]; - } - else { - return null; - } + return [level.yellow_tank_decision, null]; } }, blob: {