From d226fad168f23c7a6a38b240107dde4d7881fc88 Mon Sep 17 00:00:00 2001 From: DarkGod <darkgod@net-core.org> Date: Wed, 18 Dec 2013 23:35:07 +0100 Subject: [PATCH] Fixed the "stores wont talk to me" bug --- game/modules/tome/class/Player.lua | 6 ++++++ game/modules/tome/data/general/traps/store.lua | 10 ---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index cc4ceac288..aea2345d56 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 a4fa878a19..3e8260c571 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, } -- GitLab