Skip to content

Commit

Permalink
make [set_varialbes] mode=replace as default
Browse files Browse the repository at this point in the history
this was the previous behaviour.
It was broken in variable_info refactor.
  • Loading branch information
gfgtdf committed Jul 2, 2014
1 parent 4ff51a3 commit 2a2c16b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/game_events/action_wml.cpp
Expand Up @@ -2147,11 +2147,7 @@ WML_HANDLER_FUNCTION(set_variables, /*event_info*/, cfg)
try
{
const std::string& mode = cfg["mode"];
if(mode == "replace")
{
dest.replace_array(data);
}
else if(mode == "merge")
if(mode == "merge")
{
if(dest.explicit_index() && data.size() > 1)
{
Expand All @@ -2168,10 +2164,14 @@ WML_HANDLER_FUNCTION(set_variables, /*event_info*/, cfg)
{
dest.insert_array(data);
}
else /*default if(mode == "append")*/
else if(mode == "append")
{
dest.append_array(data);
}
else /*default if(mode == "replace")*/
{
dest.replace_array(data);
}
}
catch(const invalid_variablename_exception&)
{
Expand Down

0 comments on commit 2a2c16b

Please sign in to comment.