Skip to content

Commit

Permalink
don't save default ids in scenario editor
Browse files Browse the repository at this point in the history
these default ids might cause bugs later since the scenaro might generate units with identical ids.
  • Loading branch information
gfgtdf committed Dec 14, 2016
1 parent 1622a8c commit 95540af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/editor/map/map_context.cpp
Expand Up @@ -506,7 +506,10 @@ config map_context::to_config()
u["type"] = i->type_id();
u["canrecruit"] = i->can_recruit();
u["unrenamable"] = i->unrenamable();
u["id"] = i->id();
if(!boost::regex_match(i->id(), boost::regex(".*-[0-9]+")))
{
u["id"] = i->id();
}
u["name"] = i->name();
u["extra_recruit"] = utils::join(i->recruits());
u["facing"] = map_location::write_direction(i->facing());
Expand Down

0 comments on commit 95540af

Please sign in to comment.