diff --git a/data/ai/micro_ais/cas/ca_forest_animals_move.lua b/data/ai/micro_ais/cas/ca_forest_animals_move.lua index 21b40381769..18420346ac0 100644 --- a/data/ai/micro_ais/cas/ca_forest_animals_move.lua +++ b/data/ai/micro_ais/cas/ca_forest_animals_move.lua @@ -156,6 +156,8 @@ function ca_forest_animals_move:execution(ai, cfg) -- If this is a rabbit ending on a hole -> disappears if (unit.type == rabbit_type) and hole_map:get(farthest_hex[1], farthest_hex[2]) then wesnoth.put_unit(farthest_hex[1], farthest_hex[2]) + local command = "wesnoth.put_unit(x1, y1)" + ai.synced_command(command, farthest_hex[1], farthest_hex[2]) end end diff --git a/data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua b/data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua index a507f3e88cb..60332f45f9d 100644 --- a/data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua +++ b/data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua @@ -64,7 +64,13 @@ function ca_forest_animals_new_rabbit:execution(ai, cfg) else x, y = wesnoth.find_vacant_tile(holes[i].x, holes[i].y) end - wesnoth.put_unit(x, y, { side = wesnoth.current.side, type = cfg.rabbit_type } ) + + local command = "wesnoth.put_unit(x1, y1, { side = " + .. wesnoth.current.side + .. ", type = '" + .. cfg.rabbit_type + .. "' } )" + ai.synced_command(command, x, y) end end