From c778a007af3ccdeb09b671c31a56be7a1e3cdfc9 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 26 Feb 2017 19:28:22 -0500 Subject: [PATCH] Accept delayed_variable_substitution=no in [tunnel] ActionWML --- src/game_events/action_wml.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game_events/action_wml.cpp b/src/game_events/action_wml.cpp index 3644aa7288a1..f37ea7ce6306 100644 --- a/src/game_events/action_wml.cpp +++ b/src/game_events/action_wml.cpp @@ -857,6 +857,7 @@ WML_HANDLER_FUNCTION(terrain_mask,, cfg) WML_HANDLER_FUNCTION(tunnel,, cfg) { const bool remove = cfg["remove"].to_bool(false); + const bool delay = cfg["delayed_variable_substitution"].to_bool(true); if (remove) { const std::vector ids = utils::split(cfg["id"]); for (const std::string &id : ids) { @@ -868,11 +869,11 @@ WML_HANDLER_FUNCTION(tunnel,, cfg) ERR_WML << "[tunnel] is missing a mandatory tag:\n" << cfg.get_config().debug(); } else { - pathfind::teleport_group tunnel(cfg, false); + pathfind::teleport_group tunnel(delay ? cfg : vconfig(cfg.get_parsed_config()), false); resources::tunnels->add(tunnel); if(cfg["bidirectional"].to_bool(true)) { - tunnel = pathfind::teleport_group(cfg, true); + tunnel = pathfind::teleport_group(delay ? cfg : vconfig(cfg.get_parsed_config()), true); resources::tunnels->add(tunnel); } }