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

comment

git-svn-id: http://svn.net-core.org/repos/t-engine4@445 51575b47-30f0-44d4-a5cc-537603b46e54
parent a8da0fb2
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ end
-- @param apply an apply function that will be called on each seen grids, defaults to nil
-- @param force set to true to force a regeneration even if we did not move
-- @param no_store do not store FOV informations
-- @param cache if true it will use the cache given by the map, for the map actor. It can be used for other actors is they have the same block settings
function _M:computeFOV(radius, block, apply, force, no_store, cache)
-- If we did not move, do not update
if not force and self.fov_last_x == self.x and self.fov_last_y == self.y and self.fov_computed then return end
......
......@@ -245,9 +245,11 @@ function _M:display()
if self.level and self.level.map and self.level.map.finished then
-- Display the map and compute FOV for the player if needed
if self.level.map.changed then
-- Compute FOV, if needed
-- Clean FOV before computing it
self.level.map:cleanFOV()
-- Compute ESP FOV, using cache
if self.zone.short_name ~= "wilderness" then self.player:computeFOV(self.player.esp.range or 10, "block_esp", function(x, y) self.level.map:applyESP(x, y) end, true, true) end
-- Compute both the normal and the lite FOV, using cache
self.player:computeFOV(self.player.sight or 20, "block_sight", function(x, y, dx, dy, sqdist)
if sqdist <= self.player.lite * self.player.lite then
self.level.map:applyLite(x, y)
......@@ -256,9 +258,7 @@ function _M:display()
end
end, true, false, true)
--
-- Handle Sense spell
--
-- Handle Sense spell, a simple FOV, using cache. Note that this means some terrain features can be made to block sensing
if self.player:attr("detect_range") then
self.player:computeFOV(self.player:attr("detect_range"), "block_sense", function(x, y)
local ok = false
......
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