diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index cc4ceac28881eaf4c57d717610fa3fbc6bf06c94..aea2345d56dc05e3b7a63bce661345ac70fdbb93 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -264,6 +264,12 @@ end function _M:move(x, y, force) local ox, oy = self.x, self.y + + if not force and self:enoughEnergy() and game.level.map:checkEntity(x, y, Map.TRAP, "is_store") then + game.level.map:checkEntity(x, y, Map.TRAP, "block_move", self, true) + return false + end + local moved = mod.class.Actor.move(self, x, y, force) if not force and ox == self.x and oy == self.y and self.doPlayerSlide then diff --git a/game/modules/tome/data/general/traps/store.lua b/game/modules/tome/data/general/traps/store.lua index a4fa878a19a8dd07c9172270df4b1cf0d5186f5f..3e8260c5711f59b3ca72af5aa9d4ca036e7644f1 100644 --- a/game/modules/tome/data/general/traps/store.lua +++ b/game/modules/tome/data/general/traps/store.lua @@ -26,14 +26,4 @@ newEntity{ define_as = "BASE_STORE", is_store = true, z = 18, _noalpha = true, - on_added = function(self, level, x, y) - -- Change the terrain to be passable since we are not - game:onTickEnd(function() - local g = level.map(x, y, engine.Map.TERRAIN) - g = g:clone() - g.does_block_move = false - g.nice_tiler = nil - level.map(x, y, engine.Map.TERRAIN, g) - end) - end, }