Skip to content
Snippets Groups Projects
Commit fe33718f authored by DarkGod's avatar DarkGod
Browse files

fix stealth detection

parent 9c9fcbbc
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ local function stealthDetection(self, radius)
for i, act in ipairs(self.fov.actors_dist) do
dist = core.fov.distance(self.x, self.y, act.x, act.y)
if dist > radius then break end
if act ~= self and act:reactionToward(self) < 0 and not act:attr("blind") then
if act ~= self and act:reactionToward(self) < 0 and not act:attr("blind") and act.fov.actors[self] then
detect = detect + act:combatSeeStealth() * (1.1 - dist/10) -- detection strength reduced 10% per tile
if dist < closest then closest = dist end
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