Experimental AI: remove potential of causing errors through WML events
Events taking units off the map after the move could previously have caused errors, and thus disabled the AI for the rest of the turn.
This commit is contained in:
parent
cb86f5e868
commit
0b6fa7ed19
1 changed files with 2 additions and 0 deletions
|
@ -493,6 +493,8 @@ return {
|
|||
local defender = wesnoth.get_unit(self.data.attack.target.x, self.data.attack.target.y)
|
||||
|
||||
AH.movefull_stopunit(ai, attacker, self.data.attack.dst.x, self.data.attack.dst.y)
|
||||
if (not attacker) or (not attacker.valid) then return end
|
||||
if (not defender) or (not defender.valid) then return end
|
||||
|
||||
-- Find the poison weapon
|
||||
-- If several attacks have poison, this will always find the last one
|
||||
|
|
Loading…
Add table
Reference in a new issue