Support [break], [continue], and [return] in [random_placement]
(cherry-picked from commit 4a3508f13f
)
This commit is contained in:
parent
ab702fe19d
commit
ab36d7b600
1 changed files with 15 additions and 1 deletions
|
@ -78,8 +78,22 @@ wesnoth.wml_actions.random_placement = function(cfg)
|
|||
::continue::
|
||||
end
|
||||
end
|
||||
-- TODO: This should really be "do" but is kept as "command" for compatibility
|
||||
for do_child in wml.child_range(cfg, "command") do
|
||||
local action = utils.handle_event_commands(do_child, "loop")
|
||||
if action == "break" then
|
||||
utils.set_exiting("none")
|
||||
return
|
||||
elseif action == "continue" then
|
||||
utils.set_exiting("none")
|
||||
break
|
||||
elseif action ~= "none" then
|
||||
utils.end_var_scope(variable, variable_previous)
|
||||
return
|
||||
end
|
||||
end
|
||||
wesnoth.wml_actions.command (command)
|
||||
end
|
||||
utils.end_var_scope(variable, variable_previous)
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue