TRoW S15: Fix unit filter used by the AI
As '$this_unit' isn't created yet, we use the callable_unit given to formula [skip ci]
This commit is contained in:
parent
c1b25aa4fd
commit
cc8ec3a934
2 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ function ca_aggressive_attack_no_suicide:evaluation(ai, cfg, self)
|
|||
|
||||
local units = wesnoth.get_units {
|
||||
side = wesnoth.current.side,
|
||||
formula = '$this_unit.attacks_left > 0'
|
||||
formula = "attacks_left > 0"
|
||||
}
|
||||
--print('#units', #units)
|
||||
if (not units[1]) then return 0 end
|
||||
|
|
|
@ -7,7 +7,7 @@ function retreat:evaluation(ai, cfg, self)
|
|||
|
||||
local units = wesnoth.get_units {
|
||||
side = wesnoth.current.side,
|
||||
formula = '$this_unit.moves > 0'
|
||||
formula = 'moves > 0'
|
||||
}
|
||||
--print('#units', #units)
|
||||
if (not units[1]) then return 0 end
|
||||
|
|
Loading…
Add table
Reference in a new issue