Commit ed83108f263258ada9d52e1310272acd486856ee
1 parent
711e657b
fix T_DEMON_PLANE deactivate position & cast out of LoS
Showing
1 changed file
with
9 additions
and
3 deletions
... | ... | @@ -156,8 +156,13 @@ newTalent{ |
156 | 156 | if self:isTalentActive(t.id) then -- always hit enemies while in the Fearscape (affects AI) |
157 | 157 | return {type="ball", nolock=true, pass_terrain=true, nowarning=true, range=20, radius=20, requires_knowledge=false, selffire=false, block_path=false, block_radius=false} |
158 | 158 | else -- always hit the primary target |
159 | - local tgt = self.ai_target.actor | |
160 | - return {type="hit", range=self:getTalentRange(t), talent=t, x=tgt and tgt.x, y=tgt and tgt.y} | |
159 | + return {type="hit", range=self:getTalentRange(t), talent=t} | |
160 | + end | |
161 | + end, | |
162 | + onAIGetTarget = function(self, t) | |
163 | + if self.ai_target and self.ai_target.actor then | |
164 | + local target = self.ai_target.actor | |
165 | + return target.x, target.y, target | |
161 | 166 | end |
162 | 167 | end, |
163 | 168 | range = 5, |
... | ... | @@ -272,6 +277,7 @@ newTalent{ |
272 | 277 | local ret = { |
273 | 278 | target = target, |
274 | 279 | x = self.x, y = self.y, |
280 | + target_x = target.x, target_y = target.y, | |
275 | 281 | particle = particle, |
276 | 282 | drain_add = 0, |
277 | 283 | } |
... | ... | @@ -317,7 +323,7 @@ newTalent{ |
317 | 323 | self.x, self.y = x1, y1 |
318 | 324 | end |
319 | 325 | end |
320 | - local x2, y2 = util.findFreeGrid(p.x, p.y, 20, true, {[Map.ACTOR]=true}) | |
326 | + local x2, y2 = util.findFreeGrid(p.target_x, p.target_y, 20, true, {[Map.ACTOR]=true}) | |
321 | 327 | if not p.target.dead then |
322 | 328 | if x2 then |
323 | 329 | p.target:move(x2, y2, true) | ... | ... |
-
Please register or login to post a comment