From cf731dd9239bd27dd19d4764545f85fa43167083 Mon Sep 17 00:00:00 2001 From: mattsc Date: Fri, 21 Oct 2016 12:57:37 -0700 Subject: [PATCH] Wolves Micro AI: fix problem with target unit filtering --- data/ai/micro_ais/cas/ca_wolves_move.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/ai/micro_ais/cas/ca_wolves_move.lua b/data/ai/micro_ais/cas/ca_wolves_move.lua index a41337a08a1..7432cb76500 100644 --- a/data/ai/micro_ais/cas/ca_wolves_move.lua +++ b/data/ai/micro_ais/cas/ca_wolves_move.lua @@ -11,7 +11,10 @@ local function get_wolves(cfg) end local function get_prey(cfg) - local prey = AH.get_attackable_enemies(H.get_child(cfg, "filter_second")) + -- Note: we cannot pass H.get_child() directly to AH.get_attackable_enemies() + -- as the former returns two values and the latter takes optional arguments + local filter_second = H.get_child(cfg, "filter_second") + local prey = AH.get_attackable_enemies(filter_second) return prey end