Commit 7da3360096b011e7a7b33e57acc7170b09ca6fd3

Authored by dg
1 parent 574ca1de

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
... ... @@ -148,7 +148,8 @@ newAI("use_tactical", function(self)
148 148 -- Use the player set ai_talents weights
149 149 val = val * (self.ai_talents and self.ai_talents[t.id] or 1) * (1 + lvl / 5)
150 150 -- Update the weight by the dummy projection data
151   - if nb_foes_hit > 0 or nb_allies_hit > 0 or nb_self_hit > 0 then
  151 + -- Also force scaling if the talent requires a target (stand-in for canProject)
  152 + if self:getTalentRequiresTarget(t) or nb_foes_hit > 0 or nb_allies_hit > 0 or nb_self_hit > 0 then
152 153 val = val * (nb_foes_hit - ally_compassion * nb_allies_hit - self_compassion * nb_self_hit)
153 154 end
154 155 -- Only take values greater than 0... allows the ai_talents to turn talents off
... ...