Bläddra i källkod

Fixed several scenarios with incorrect scope for requesting identifiers

Ivan Savenko 2 år sedan
förälder
incheckning
23cb47b457
3 ändrade filer med 3 tillägg och 3 borttagningar
  1. 1 1
      lib/GameConstants.cpp
  2. 1 1
      lib/mapObjects/CGHeroInstance.cpp
  3. 1 1
      lib/spells/CSpellHandler.cpp

+ 1 - 1
lib/GameConstants.cpp

@@ -62,7 +62,7 @@ namespace GameConstants
 
 si32 HeroTypeID::decode(const std::string & identifier)
 {
-	auto rawId = VLC->modh->identifiers.getIdentifier(CModHandler::scopeBuiltin(), "hero", identifier);
+	auto rawId = VLC->modh->identifiers.getIdentifier(CModHandler::scopeMap(), "hero", identifier);
 	if(rawId)
 		return rawId.get();
 	else

+ 1 - 1
lib/mapObjects/CGHeroInstance.cpp

@@ -1413,7 +1413,7 @@ void CGHeroInstance::setHeroTypeName(const std::string & identifier)
 {
 	if(ID == Obj::HERO || ID == Obj::PRISON)
 	{
-		auto rawId = VLC->modh->identifiers.getIdentifier(CModHandler::scopeBuiltin(), "hero", identifier);
+		auto rawId = VLC->modh->identifiers.getIdentifier(CModHandler::scopeMap(), "hero", identifier);
 
 		if(rawId)
 			subID = rawId.get();

+ 1 - 1
lib/spells/CSpellHandler.cpp

@@ -763,7 +763,7 @@ CSpell * CSpellHandler::loadFromJson(const std::string & scope, const JsonNode &
 	{
 		if(counteredSpell.second.Bool())
 		{
-			VLC->modh->identifiers.requestIdentifier(json.meta, counteredSpell.first, [=](si32 id)
+			VLC->modh->identifiers.requestIdentifier(counteredSpell.second.meta, counteredSpell.first, [=](si32 id)
 			{
 				spell->counteredSpells.push_back(SpellID(id));
 			});