Skip to content

Commit

Permalink
TRoW S15: Fix unit filter used by the AI
Browse files Browse the repository at this point in the history
As '$this_unit' isn't created yet, we use the callable_unit given to formula

[skip ci]
  • Loading branch information
aquileia committed Jan 28, 2015
1 parent c1b25aa commit cc8ec3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data/campaigns/The_Rise_Of_Wesnoth/ai/ca_retreat.lua
Expand Up @@ -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
Expand Down

0 comments on commit cc8ec3a

Please sign in to comment.