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

core.fov.calc_*() now take the map size(w, h) as third and fourth parameters

git-svn-id: http://svn.net-core.org/repos/t-engine4@2413 51575b47-30f0-44d4-a5cc-537603b46e54
parent 26b48251
No related branches found
No related tags found
No related merge requests found
......@@ -388,7 +388,7 @@ end
local function spotHostiles(self)
local seen = false
-- Check for visible monsters, only see LOS actors, so telepathy wont prevent resting
core.fov.calc_circle(self.x, self.y, 20, function(_, x, y) return game.level.map:opaque(x, y) end, function(_, x, y)
core.fov.calc_circle(self.x, self.y, game.level.w, game.level.h, 20, function(_, x, y) return game.level.map:opaque(x, y) end, function(_, x, y)
local actor = game.level.map(x, y, game.level.map.ACTOR)
if actor and self:reactionToward(actor) < 0 and self:canSee(actor) and game.level.map.seens(x, y) then seen = true end
end, nil)
......
......@@ -154,7 +154,7 @@ end
local function spotHostiles(self)
local seen = false
-- Check for visible monsters, only see LOS actors, so telepathy wont prevent resting
core.fov.calc_circle(self.x, self.y, 20, function(_, x, y) return game.level.map:opaque(x, y) end, function(_, x, y)
core.fov.calc_circle(self.x, self.y, game.level.w, game.level.h, 20, function(_, x, y) return game.level.map:opaque(x, y) end, function(_, x, y)
local actor = game.level.map(x, y, game.level.map.ACTOR)
if actor and self:reactionToward(actor) < 0 and self:canSee(actor) and game.level.map.seens(x, y) then seen = true end
end, nil)
......
......@@ -153,7 +153,7 @@ end
local function spotHostiles(self)
local seen = false
-- Check for visible monsters, only see LOS actors, so telepathy wont prevent resting
core.fov.calc_circle(self.x, self.y, 20, function(_, x, y) return game.level.map:opaque(x, y) end, function(_, x, y)
core.fov.calc_circle(self.x, self.y, game.level.w, game.level.h, 20, function(_, x, y) return game.level.map:opaque(x, y) end, function(_, x, y)
local actor = game.level.map(x, y, game.level.map.ACTOR)
if actor and self:reactionToward(actor) < 0 and self:canSee(actor) and game.level.map.seens(x, y) then seen = true end
end, nil)
......
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