Skip to content

Commit

Permalink
support container variables in [options] (#975)
Browse files Browse the repository at this point in the history
options setting attributes in a container like
```
[options]
  [slider]
    id="container.attribute"
    ....
  [/slider]
[/options]
```
were broken in a previous refactor in 1.13.0. This commit should restore them.
  • Loading branch information
gfgtdf authored and CelticMinstrel committed Apr 7, 2017
1 parent 2107145 commit 9d2b0f6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/saved_game.cpp
Expand Up @@ -372,7 +372,14 @@ void saved_game::expand_mp_options()
{
for(const config& option : cfg.child_range("option"))
{
variables[option["id"]] = option["value"];
try
{
variable_access_create(option["id"], variables).as_scalar() = option["value"];
}
catch(const invalid_variablename_exception&)
{
ERR_NG << "variable " << option["id"] << "cannot be set to " << option["value"] << std::endl;
}
}
}
else
Expand Down

0 comments on commit 9d2b0f6

Please sign in to comment.