Commit 7da3360096b011e7a7b33e57acc7170b09ca6fd3
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
Showing
1 changed file
with
2 additions
and
1 deletions
@@ -148,7 +148,8 @@ newAI("use_tactical", function(self) | @@ -148,7 +148,8 @@ newAI("use_tactical", function(self) | ||
148 | -- Use the player set ai_talents weights | 148 | -- Use the player set ai_talents weights |
149 | val = val * (self.ai_talents and self.ai_talents[t.id] or 1) * (1 + lvl / 5) | 149 | val = val * (self.ai_talents and self.ai_talents[t.id] or 1) * (1 + lvl / 5) |
150 | -- Update the weight by the dummy projection data | 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 | val = val * (nb_foes_hit - ally_compassion * nb_allies_hit - self_compassion * nb_self_hit) | 153 | val = val * (nb_foes_hit - ally_compassion * nb_allies_hit - self_compassion * nb_self_hit) |
153 | end | 154 | end |
154 | -- Only take values greater than 0... allows the ai_talents to turn talents off | 155 | -- Only take values greater than 0... allows the ai_talents to turn talents off |
-
Please register or login to post a comment