From fe33718fbbc1e9fce9f2c70495648bbad924abac Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Tue, 5 Nov 2013 02:12:03 +0100
Subject: [PATCH] fix stealth detection

---
 game/modules/tome/data/talents/cunning/stealth.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/game/modules/tome/data/talents/cunning/stealth.lua b/game/modules/tome/data/talents/cunning/stealth.lua
index 18efd70a7d..651190a90b 100644
--- a/game/modules/tome/data/talents/cunning/stealth.lua
+++ b/game/modules/tome/data/talents/cunning/stealth.lua
@@ -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
-- 
GitLab