mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-25 04:26:02 +00:00
Add range support for [micro_ai]side= (#7853)
This commit is contained in:
parent
83ab05532a
commit
14c7382675
@ -19,9 +19,8 @@ function wesnoth.wml_actions.micro_ai(cfg)
|
||||
-- Check that the required common keys are all present and set correctly
|
||||
if (not cfg.ai_type) then wml.error("[micro_ai] is missing required ai_type= key") end
|
||||
if (not cfg.side) then wml.error("[micro_ai] is missing required side= key") end
|
||||
if string.find(cfg.side, ',') then
|
||||
local sides = stringx.split(cfg.side)
|
||||
for _,side in ipairs(sides) do
|
||||
if string.find(cfg.side, ',') or string.find(cfg.side, '-') then
|
||||
for side in stringx.iter_ranges(cfg.side) do
|
||||
cfg.side = tonumber(side)
|
||||
wesnoth.wml_actions.micro_ai(cfg)
|
||||
end
|
||||
|
@ -1256,7 +1256,7 @@
|
||||
max=infinite
|
||||
{INSERT_TAG}
|
||||
{REQUIRED_KEY ai_type string}
|
||||
{REQUIRED_KEY side s_unsigned}
|
||||
{REQUIRED_KEY side s_unsigned_range_list}
|
||||
{REQUIRED_KEY action micro_ai_action}
|
||||
{SIMPLE_KEY ca_id string}
|
||||
[if]
|
||||
|
Loading…
x
Reference in New Issue
Block a user