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:
mattsc 2014-02-28 07:03:02 -08:00
parent cb86f5e868
commit 0b6fa7ed19

View file

@ -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