From 86bdae3ec64743860227da4e081a956132c2ec56 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Tue, 15 Feb 2011 12:29:41 +0000
Subject: [PATCH] Cant nager npcs by not doing them any damage

git-svn-id: http://svn.net-core.org/repos/t-engine4@2732 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/NPC.lua | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/game/modules/tome/class/NPC.lua b/game/modules/tome/class/NPC.lua
index 45e0a555a0..41a38ad14f 100644
--- a/game/modules/tome/class/NPC.lua
+++ b/game/modules/tome/class/NPC.lua
@@ -110,12 +110,14 @@ end
 --- Called by ActorLife interface
 -- We use it to pass aggression values to the AIs
 function _M:onTakeHit(value, src)
-	if not self.ai_target.actor and src and src.targetable then
+	value = mod.class.Actor.onTakeHit(self, value, src)
+
+	if not self.ai_target.actor and src and src.targetable and value > 0 then
 		self.ai_target.actor = src
 	end
 
 	-- Get angry if attacked by a friend
-	if src and src ~= self and src.resolveSource and src.faction and self:reactionToward(src) >= 0 then
+	if src and src ~= self and src.resolveSource and src.faction and self:reactionToward(src) >= 0 and value > 0 then
 		self:checkAngered(src, false, -50)
 
 		-- Call for help if we become hostile
@@ -127,7 +129,7 @@ function _M:onTakeHit(value, src)
 		end
 	end
 
-	return mod.class.Actor.onTakeHit(self, value, src)
+	return value
 end
 
 function _M:die(src)
-- 
GitLab