From b3058e8e8eb119db883a1543143bd4523c93f239 Mon Sep 17 00:00:00 2001 From: mattsc Date: Mon, 27 Aug 2018 07:13:18 -0700 Subject: [PATCH] Messenger MAI Lua code: change proxy unit location directly --- data/ai/micro_ais/cas/ca_messenger_move.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/ai/micro_ais/cas/ca_messenger_move.lua b/data/ai/micro_ais/cas/ca_messenger_move.lua index 0b91e2ceb183..ba3d8a3c9a1e 100644 --- a/data/ai/micro_ais/cas/ca_messenger_move.lua +++ b/data/ai/micro_ais/cas/ca_messenger_move.lua @@ -59,17 +59,17 @@ function ca_messenger_move:execution(cfg) if (unit_in_way == messenger) then unit_in_way = nil end if unit_in_way then unit_in_way:extract() end - wesnoth.put_unit(messenger, next_hop[1], next_hop[2]) + messenger.loc = { next_hop[1], next_hop[2] } local _, cost1 = AH.find_path_with_shroud(messenger, x, y, { ignore_units = 'yes' }) local unit_in_way2 = wesnoth.get_unit(optimum_hop[1], optimum_hop[2]) if (unit_in_way2 == messenger) then unit_in_way2 = nil end if unit_in_way2 then unit_in_way2:extract() end - wesnoth.put_unit(messenger, optimum_hop[1], optimum_hop[2]) + messenger.loc = { optimum_hop[1], optimum_hop[2] } local _, cost2 = AH.find_path_with_shroud(messenger, x, y, { ignore_units = 'yes' }) - wesnoth.put_unit(messenger, x_current, y_current) + messenger.loc = { x_current, y_current } if unit_in_way then unit_in_way:to_map() end if unit_in_way2 then unit_in_way2:to_map() end