Skip to content
Snippets Groups Projects
Commit 86bdae3e authored by dg's avatar dg
Browse files

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
parent d099e510
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
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