High XP attack CA: do not try to attack petrified enemies

This commit is contained in:
mattsc 2016-10-02 09:11:44 -07:00
parent 371b9b67ec
commit 52826a3824

View file

@ -55,6 +55,7 @@ function ca_attack_highxp:evaluation(cfg, data)
for i_t,enemy in ipairs(all_units) do
if wesnoth.is_enemy(wesnoth.current.side, enemy.side)
and enemy:matches({ { "filter_vision", { side = wesnoth.current.side, visible = 'yes' } } })
and (not enemy.status.petrified)
then
local XP_to_levelup = enemy.max_experience - enemy.experience
if (max_unit_level >= XP_to_levelup) then