mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 06:57:25 +00:00
High XP attack CA: do not try to attack petrified enemies
This commit is contained in:
parent
371b9b67ec
commit
52826a3824
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user