Moved [command] implementation to Lua.

This commit is contained in:
Guillaume Melquiond 2010-07-19 12:42:10 +00:00
parent 2000467e12
commit 093c9996ee
2 changed files with 11 additions and 7 deletions

View file

@ -278,3 +278,14 @@ end
function wml_actions.music(cfg)
wesnoth.set_music(cfg)
end
local function handle_event_commands(cfg)
for i = 1, #cfg do
local v = cfg[i]
wml_actions[v[1]](v[2])
end
-- Apply music alterations once all the commands have been processed.
wesnoth.set_music()
end
wml_actions.command = handle_event_commands

View file

@ -2603,13 +2603,6 @@ WML_HANDLER_FUNCTION(heal_unit, event_info, cfg)
resources::state_of_game->get_variable("heal_amount") = real_amount;
}
// Sub commands that need to be handled in a guaranteed ordering
WML_HANDLER_FUNCTION(command, event_info, cfg)
{
handle_event_commands(event_info, cfg);
}
// Allow undo sets the flag saying whether the event has mutated the game to false
WML_HANDLER_FUNCTION(allow_undo,/*event_info*/,/*cfg*/)
{