Skip to content

Commit

Permalink
Support delayed_variable_substitution= in [on_undo], [on_redo]
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Mar 22, 2016
1 parent 0ac0981 commit ee80e66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions src/game_events/action_wml.cpp
Expand Up @@ -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
Expand Down

0 comments on commit ee80e66

Please sign in to comment.