From ee80e66f95be338ac1d8e1fb77197aadc23ef5fd Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 22 Mar 2016 15:35:16 -0400 Subject: [PATCH] Support delayed_variable_substitution= in [on_undo], [on_redo] --- changelog | 1 + src/game_events/action_wml.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/changelog b/changelog index 32c0c92e231b..61e629bac8c5 100644 --- a/changelog +++ b/changelog @@ -13,6 +13,7 @@ Version 1.13.4+dev: interpolation scaling. * New ~SCALE_INTO_SHARP(w,h) IPF which preserves aspect ratio, using nearest neighbor scaling. + * Support delayed_variable_substitution= in [on_undo], [on_redo] * Lua API: * wesnoth.match_unit can now take a location (rather than a unit) as the optional third parameter. This will cause the filter to consider diff --git a/src/game_events/action_wml.cpp b/src/game_events/action_wml.cpp index 4549dcdf6e78..62b5accb00ae 100644 --- a/src/game_events/action_wml.cpp +++ b/src/game_events/action_wml.cpp @@ -1281,12 +1281,20 @@ WML_HANDLER_FUNCTION(wml_message, cfg) WML_HANDLER_FUNCTION(on_undo, cfg) { - synced_context::add_undo_commands(cfg.get_parsed_config()); + if(cfg["delayed_variable_substitution"].to_bool(false)) { + synced_context::add_undo_commands(cfg.get_config()); + } else { + synced_context::add_undo_commands(cfg.get_parsed_config()); + } } WML_HANDLER_FUNCTION(on_redo, cfg) { - synced_context::add_redo_commands(cfg.get_parsed_config()); + if(cfg["delayed_variable_substitution"].to_bool(false)) { + synced_context::add_redo_commands(cfg.get_config()); + } else { + synced_context::add_redo_commands(cfg.get_parsed_config()); + } } } // end namespace game_events