Skip to content
Snippets Groups Projects
Commit 50603c0c authored by dg's avatar dg
Browse files

fixes

git-svn-id: http://svn.net-core.org/repos/t-engine4@4883 51575b47-30f0-44d4-a5cc-537603b46e54
parent 9f47301a
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ module(..., package.seeall, class.make)
local function checkDir(a, dir, dist)
dist = dist or 1
local x, y = a.x, a.y
for i = 1, dist do util.coordAddDir(x, y, dir) end
for i = 1, dist do x, y = util.coordAddDir(x, y, dir) end
-- don't treat other actors as terrain or as something to notice (let the module handle this)
if game.level.map(x, y, game.level.map.ACTOR) and not game.level.map:checkEntity(x, y, game.level.map.TERRAIN, "block_move") then return false end
return (game.level.map:checkAllEntities(x, y, "block_move", a) or not game.level.map:isBound(x, y)) and true or false
......
......@@ -43,7 +43,7 @@ newEntity{ base = "TRAP_COMPLEX",
g = game.level.map(i, j, engine.Map.TERRAIN)
until not g or g:check("block_move")
if g and not g.is_door and core.fov.distance(x, y, i, j) >= 2 then
i, j = util.coordAddDir(i, j, opposed_dir[dir])
i, j = util.coordAddDir(i, j, util.opposedDir(dir, i, j))
walls[#walls+1] = {x=i, y=j}
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