1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Cleared up comments

This commit is contained in:
Ivan Savenko 2022-11-30 17:36:55 +02:00
parent 36ae26bc37
commit 79c96e94fa
2 changed files with 11 additions and 2 deletions

View File

@ -206,8 +206,11 @@ std::vector<CIdentifierStorage::ObjectData> CIdentifierStorage::getPossibleIdent
std::set<std::string> allowedScopes;
bool isValidScope = true;
// called have not specified destination mod explicitly
if (request.remoteScope.empty())
{
// FIXME: temporary, for queries from map loader allow access to any identifer
// should be changed to list of mods that are marked as required by current map
if (request.localScope == "map")
{
for (auto const & modName : VLC->modh->getActiveMods())
@ -221,13 +224,16 @@ std::vector<CIdentifierStorage::ObjectData> CIdentifierStorage::getPossibleIdent
if(!isValidScope)
return std::vector<ObjectData>();
allowedScopes.insert(request.localScope);
}
allowedScopes.insert(request.localScope);
// all mods can access built-in mod
allowedScopes.insert("core");
}
else
{
//...unless destination mod was specified explicitly
//if destination mod was specified explicitly, restrict lookup to this mod
if(request.remoteScope == "core" )
{

View File

@ -44,6 +44,9 @@ void CTownInstanceConstructor::initTypeData(const JsonNode & input)
});
filtersJson = input["filters"];
// change scope of "filters" to scope of object that is being loaded
// since this filters require to resolve building ID's
filtersJson.setMeta(input["faction"].meta);
}