From 4edc83ae4f743c0536458ecdd1d5bbbc4cc0afdc Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Sat, 19 Sep 2020 20:35:12 -0600 Subject: [PATCH] Restore bumping solid tiles --- js/game.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/game.js b/js/game.js index cf74385..e769387 100644 --- a/js/game.js +++ b/js/game.js @@ -577,12 +577,13 @@ export class Level { ! old_cell.blocks_leaving(actor, dir2)) { let neighbor = this.cell_with_offset(old_cell, dir2); - if (neighbor && ! neighbor.blocks_entering(actor, dir2, this, true)) { + if (neighbor) { + let could_push = ! neighbor.blocks_entering(actor, dir2, this, true); for (let tile of Array.from(neighbor)) { if (tile.type.on_bump) { tile.type.on_bump(tile, this, actor); } - if (actor.can_push(tile)) { + if (could_push && actor.can_push(tile)) { // Block slapping: you can shove a block by walking past it sideways this.set_actor_direction(tile, dir2); this.attempt_step(tile, dir2);