mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 20:25:27 +00:00
SotBE AI: Don't assume unit.__cfg contains a "variables" tag
This commit is contained in:
parent
bb4402489c
commit
ff16302b9f
@ -15,8 +15,7 @@ function ca_transport:evaluation()
|
||||
local units = wesnoth.get_units { side = wesnoth.current.side, formula = 'movement_left > 0' }
|
||||
|
||||
for i,u in ipairs(units) do
|
||||
local vars = H.get_child(u.__cfg, "variables")
|
||||
if vars.destination_x and vars.destination_y then
|
||||
if u.variables.destination_x and u.variables.destination_y then
|
||||
return 300000
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user