Skip to content

Commit

Permalink
Accept delayed_variable_substitution=no in [tunnel] ActionWML
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Feb 27, 2017
1 parent 6af3dd9 commit c778a00
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/game_events/action_wml.cpp
Expand Up @@ -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<std::string> ids = utils::split(cfg["id"]);
for (const std::string &id : ids) {
Expand All @@ -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);
}
}
Expand Down

0 comments on commit c778a00

Please sign in to comment.