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

fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@1097 51575b47-30f0-44d4-a5cc-537603b46e54
parent aac44822
No related branches found
No related tags found
No related merge requests found
......@@ -86,12 +86,12 @@ function _M:display(dispx, dispy)
if s == self.b then stopx, stopy = self.target.x, self.target.y end
if self.target_type.ball then
if self.target_type.ball and self.target_type.ball > 0 then
core.fov.calc_circle(stopx, stopy, self.target_type.ball, function(_, lx, ly)
self.sg:toScreen(self.display_x + (lx - game.level.map.mx) * self.tile_w * Map.zoom, self.display_y + (ly - game.level.map.my) * self.tile_h * Map.zoom, self.tile_w * Map.zoom, self.tile_h * Map.zoom)
if not self.target_type.no_restrict and game.level.map:checkEntity(lx, ly, Map.TERRAIN, "block_move") then return true end
end, function()end, nil)
elseif self.target_type.cone then
elseif self.target_type.cone and self.target_type.cone > 0 then
core.fov.calc_beam(stopx, stopy, self.target_type.cone, initial_dir, self.target_type.cone_angle, function(_, lx, ly)
self.sg:toScreen(self.display_x + (lx - game.level.map.mx) * self.tile_w * Map.zoom, self.display_y + (ly - game.level.map.my) * self.tile_h * Map.zoom, self.tile_w * Map.zoom, self.tile_h * Map.zoom)
if not self.target_type.no_restrict and game.level.map:checkEntity(lx, ly, Map.TERRAIN, "block_move") then return true 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