Index: game/engines/default/engine/Target.lua =================================================================== --- game/engines/default/engine/Target.lua (revision 3922) +++ game/engines/default/engine/Target.lua (working copy) @@ -185,7 +185,10 @@ friendlyfire=true, block_path = function(typ, lx, ly) if not typ.no_restrict then - if typ.range and typ.source_actor and typ.source_actor.x then + if typ.range and typ.start_x then + local dist = core.fov.distance(typ.start_x, typ.start_y, lx, ly) + if math.floor(dist - typ.range + 0.5) > 0 then return true, false, false end + elseif typ.range and typ.source_actor and typ.source_actor.x then local dist = core.fov.distance(typ.source_actor.x, typ.source_actor.y, lx, ly) if math.floor(dist - typ.range + 0.5) > 0 then return true, false, false end end Index: game/engines/default/engine/interface/ActorProject.lua =================================================================== --- game/engines/default/engine/interface/ActorProject.lua (revision 3922) +++ game/engines/default/engine/interface/ActorProject.lua (working copy) @@ -169,6 +169,8 @@ function _M:canProject(t, x, y) local typ = Target:getType(t) typ.source_actor = self + typ.start_x = self.x + typ.start_y = self.y -- Stop at range or on block local lx, ly = x, y @@ -214,6 +216,8 @@ -- if type(dam) == "number" and dam < 0 then return end local typ = Target:getType(t) typ.source_actor = self + typ.start_x = self.x + typ.start_y = self.y local proj = require(self.projectile_class):makeProject(self, t.display, {x=x, y=y, start_x = t.x or self.x, start_y = t.y or self.y, damtype=damtype, tg=t, typ=typ, dam=dam, particles=particles}) game.zone:addEntity(game.level, proj, "projectile", t.x or self.x, t.y or self.y)