diff --git a/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg b/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg index dbea8afb50cd..faaa9c74b86a 100644 --- a/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg +++ b/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg @@ -151,29 +151,20 @@ Elvish Shaman, Elvish Shyde, Elvish Enchantress, Elvish Sorceress, Elvish Sylph, # Thanks to Shadow Master for this macro # !***Macro to random place unit within area*** #define RANDOM_PLACEMENT _X _Y _RADIUS _WML - [store_locations] - x,y={_X},{_Y} - radius={_RADIUS} - variable=random_placement_locations - [/store_locations] - - {VARIABLE_OP random_string value "0..$random_placement_locations.length"} - - {RANDOM $random_string} - - {VARIABLE_OP random_placement_x value "$random_placement_locations[$random].x"} - {VARIABLE_OP random_placement_y value "$random_placement_locations[$random].y"} - - {CLEAR_VARIABLE random_placement_locations} - - {_WML} - - [+unit] - x,y=$random_placement_x,$random_placement_y - [/unit] - - {CLEAR_VARIABLE random_placement_x} - {CLEAR_VARIABLE random_placement_y} + [random_placement] + num_items=1 + variable=random_placement_location + [filter_location] + x,y={_X},{_Y} + radius={_RADIUS} + [/filter_location] + [command] + {_WML} + [+unit] + x,y=$random_placement_location.x,$random_placement_location.y + [/unit] + [/command] + [/random_placement] #enddef #define STORE_SIDE SIDE