Skip to content
Snippets Groups Projects
Commit 7da33600 authored by dg's avatar dg
Browse files

Fix tactical AI trying to shoot through walls

git-svn-id: http://svn.net-core.org/repos/t-engine4@3407 51575b47-30f0-44d4-a5cc-537603b46e54
parent 574ca1de
No related branches found
No related tags found
No related merge requests found
......@@ -148,7 +148,8 @@ newAI("use_tactical", function(self)
-- Use the player set ai_talents weights
val = val * (self.ai_talents and self.ai_talents[t.id] or 1) * (1 + lvl / 5)
-- Update the weight by the dummy projection data
if nb_foes_hit > 0 or nb_allies_hit > 0 or nb_self_hit > 0 then
-- Also force scaling if the talent requires a target (stand-in for canProject)
if self:getTalentRequiresTarget(t) or nb_foes_hit > 0 or nb_allies_hit > 0 or nb_self_hit > 0 then
val = val * (nb_foes_hit - ally_compassion * nb_allies_hit - self_compassion * nb_self_hit)
end
-- Only take values greater than 0... allows the ai_talents to turn talents off
......
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