From 08cc3473ea21ab95039b0eb7f17f17225d6b981d Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Sat, 28 Aug 2010 23:29:58 +0000 Subject: [PATCH] fix git-svn-id: http://svn.net-core.org/repos/t-engine4@1097 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engine/Target.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/engine/Target.lua b/game/engine/Target.lua index 05234fb737..92da5ba70e 100644 --- a/game/engine/Target.lua +++ b/game/engine/Target.lua @@ -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 -- GitLab