mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
Fixes identifiers resolving for json serialization
This commit is contained in:
@ -209,8 +209,7 @@ std::vector<CIdentifierStorage::ObjectData> CIdentifierStorage::getPossibleIdent
|
||||
// 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
|
||||
// "map" is special scope that should have access to all in-game objects
|
||||
if (request.localScope == "map")
|
||||
{
|
||||
for (auto const & modName : VLC->modh->getActiveMods())
|
||||
@ -234,12 +233,16 @@ std::vector<CIdentifierStorage::ObjectData> CIdentifierStorage::getPossibleIdent
|
||||
else
|
||||
{
|
||||
//if destination mod was specified explicitly, restrict lookup to this mod
|
||||
|
||||
if(request.remoteScope == "core" )
|
||||
{
|
||||
//"core" mod is an implicit dependency for all mods, allow access into it
|
||||
allowedScopes.insert(request.remoteScope);
|
||||
}
|
||||
else if ( request.localScope == "map" )
|
||||
{
|
||||
// allow access, "map" is special scope that should have access to all in-game objects
|
||||
allowedScopes.insert(request.remoteScope);
|
||||
}
|
||||
else if(request.remoteScope == request.localScope )
|
||||
{
|
||||
// allow self-access
|
||||
|
Reference in New Issue
Block a user