Skip to content
Snippets Groups Projects
Commit d226fad1 authored by DarkGod's avatar DarkGod
Browse files

Fixed the "stores wont talk to me" bug

parent 5ebabf88
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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,
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment