From 26985600b283c0c18e6ef91f74ae0cfe358bdb61 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 21 Dec 2022 19:00:36 +0200 Subject: [PATCH] Fixed several more cases of incorrect scope for identifiers resolving --- lib/CCreatureSet.cpp | 2 +- lib/CSkillHandler.cpp | 2 +- lib/mapObjects/CGTownInstance.cpp | 2 +- lib/mapObjects/CQuest.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/CCreatureSet.cpp b/lib/CCreatureSet.cpp index e6efe84e3..83c740c5c 100644 --- a/lib/CCreatureSet.cpp +++ b/lib/CCreatureSet.cpp @@ -1053,7 +1053,7 @@ void CStackBasicDescriptor::serializeJson(JsonSerializeFormat & handler) std::string typeName(""); handler.serializeString("type", typeName); if(!typeName.empty()) - setType(VLC->creh->getCreature(CModHandler::scopeBuiltin(), typeName)); + setType(VLC->creh->getCreature(CModHandler::scopeMap(), typeName)); } } diff --git a/lib/CSkillHandler.cpp b/lib/CSkillHandler.cpp index c6adef050..8a1a70c72 100644 --- a/lib/CSkillHandler.cpp +++ b/lib/CSkillHandler.cpp @@ -267,7 +267,7 @@ std::vector CSkillHandler::getDefaultAllowed() const si32 CSkillHandler::decodeSkill(const std::string & identifier) { - auto rawId = VLC->modh->identifiers.getIdentifier(CModHandler::scopeBuiltin(), "skill", identifier); + auto rawId = VLC->modh->identifiers.getIdentifier(CModHandler::scopeMap(), "skill", identifier); if(rawId) return rawId.get(); else diff --git a/lib/mapObjects/CGTownInstance.cpp b/lib/mapObjects/CGTownInstance.cpp index 220ae6882..bb6a0bb8c 100644 --- a/lib/mapObjects/CGTownInstance.cpp +++ b/lib/mapObjects/CGTownInstance.cpp @@ -1466,7 +1466,7 @@ void CGTownInstance::serializeJsonOptions(JsonSerializeFormat & handler) { auto decodeBuilding = [this](const std::string & identifier) -> si32 { - auto rawId = VLC->modh->identifiers.getIdentifier(CModHandler::scopeBuiltin(), getTown()->getBuildingScope(), identifier); + auto rawId = VLC->modh->identifiers.getIdentifier(CModHandler::scopeMap(), getTown()->getBuildingScope(), identifier); if(rawId) return rawId.get(); diff --git a/lib/mapObjects/CQuest.cpp b/lib/mapObjects/CQuest.cpp index 85f612899..837841715 100644 --- a/lib/mapObjects/CQuest.cpp +++ b/lib/mapObjects/CQuest.cpp @@ -1028,7 +1028,7 @@ void CGSeerHut::serializeJsonOptions(JsonSerializeFormat & handler) if(doRequest) { - auto rawId = VLC->modh->identifiers.getIdentifier(CModHandler::scopeBuiltin(), fullIdentifier, false); + auto rawId = VLC->modh->identifiers.getIdentifier(CModHandler::scopeMap(), fullIdentifier, false); if(rawId) {