Showing
2 changed files
with
2 additions
and
2 deletions
... | ... | @@ -30,7 +30,7 @@ newAI("dumb_talented", function(self) |
30 | 30 | -- print(self.name, self.uid, "dumb ai talents can try use", t.name, tid, "::", t.mode, not self:isTalentCoolingDown(t), target_dist <= self:getTalentRange(t), self:preUseTalent(t, true), self:canProject({type="bolt"}, self.ai_target.actor.x, self.ai_target.actor.y)) |
31 | 31 | -- For dumb AI assume we need range and LOS |
32 | 32 | -- No special check for bolts, etc. |
33 | - local total_range = self:getTalentRange(t) + self:getTalentRadius(t) | |
33 | + local total_range = (self:getTalentRange(t) or 0) + (self:getTalentRadius(t) or 0) | |
34 | 34 | local tg = {type=util.getval(t.direct_hit, self, t) and "hit" or "bolt", range=total_range} |
35 | 35 | if t.mode == "activated" and not t.no_npc_use and |
36 | 36 | not self:isTalentCoolingDown(t) and self:preUseTalent(t, true, true) and | ... | ... |
... | ... | @@ -83,7 +83,7 @@ newAI("use_tactical", function(self) |
83 | 83 | local tg = self:getTalentTarget(t) |
84 | 84 | local default_tg = {type=util.getval(t.direct_hit, self, t) and "hit" or "bolt"} |
85 | 85 | -- Only assume range... some talents may no require LOS, etc |
86 | - local within_range = target_dist and target_dist <= (self:getTalentRange(t) + self:getTalentRadius(t)) | |
86 | + local within_range = target_dist and target_dist <= ((self:getTalentRange(t) or 0) + (self:getTalentRadius(t) or 0)) | |
87 | 87 | if t.mode == "activated" and not t.no_npc_use and |
88 | 88 | not self:isTalentCoolingDown(t) and self:preUseTalent(t, true, true) and |
89 | 89 | (not self:getTalentRequiresTarget(t) or within_range) | ... | ... |
-
Please register or login to post a comment