Skip to content

Commit

Permalink
Support [break], [continue], and [return] in [random_placement]
Browse files Browse the repository at this point in the history
(cherry-picked from commit 4a3508f)
  • Loading branch information
CelticMinstrel committed Oct 7, 2018
1 parent ab702fe commit ab36d7b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion data/lua/wml/random_placement.lua
Expand Up @@ -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

0 comments on commit ab36d7b

Please sign in to comment.