From 48a0920732f27e373bf27e982296dea8d18ddf88 Mon Sep 17 00:00:00 2001 From: mattsc Date: Sat, 3 May 2014 17:46:37 -0700 Subject: [PATCH] Fast Micro AI: exclude guardians from move-to-targets CA --- data/ai/micro_ais/cas/ca_fast_move.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data/ai/micro_ais/cas/ca_fast_move.lua b/data/ai/micro_ais/cas/ca_fast_move.lua index 41ea9d0df59..70d4849654b 100644 --- a/data/ai/micro_ais/cas/ca_fast_move.lua +++ b/data/ai/micro_ais/cas/ca_fast_move.lua @@ -14,7 +14,12 @@ function ca_fast_move:execution(ai, cfg, self) local move_cost_factor = cfg.move_cost_factor or 2.0 if (move_cost_factor < 1.1) then move_cost_factor = 1.1 end - local units = AH.get_units_with_moves { side = wesnoth.current.side, canrecruit = 'no' } + local all_units_MP = AH.get_units_with_moves { side = wesnoth.current.side, canrecruit = 'no' } + local units = {} + for _,unit in ipairs(all_units_MP) do + if (not unit.status.guardian) then table.insert(units, unit) end + end + local leader = wesnoth.get_units { side = wesnoth.current.side, canrecruit = 'yes' }[1] local goals = {}