1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-31 00:07:39 +02:00

Fix subObject identification

This commit is contained in:
AlexVinS
2015-11-16 17:38:42 +03:00
parent b56b7017ba
commit 3f79d001c1
4 changed files with 24 additions and 6 deletions

View File

@@ -884,3 +884,16 @@ void CModHandler::afterLoad()
std::ofstream file(*CResourceHandler::get()->getResourceName(ResourceID("config/modSettings.json")), std::ofstream::trunc);
file << modSettings;
}
std::string CModHandler::normalizeIdentifier(const std::string & scope, const std::string & remoteScope, const std::string & identifier) const
{
auto p = splitString(identifier, ':');
if(p.first.empty())
p.first = scope;
if(p.first == remoteScope)
p.first.clear();
return p.first.empty() ? p.second : p.first +":"+p.second;
}