mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fixed several scenarios with incorrect scope for requesting identifiers
This commit is contained in:
		| @@ -62,7 +62,7 @@ namespace GameConstants | |||||||
|  |  | ||||||
| si32 HeroTypeID::decode(const std::string & identifier) | 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) | 	if(rawId) | ||||||
| 		return rawId.get(); | 		return rawId.get(); | ||||||
| 	else | 	else | ||||||
|   | |||||||
| @@ -1413,7 +1413,7 @@ void CGHeroInstance::setHeroTypeName(const std::string & identifier) | |||||||
| { | { | ||||||
| 	if(ID == Obj::HERO || ID == Obj::PRISON) | 	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) | 		if(rawId) | ||||||
| 			subID = rawId.get(); | 			subID = rawId.get(); | ||||||
|   | |||||||
| @@ -763,7 +763,7 @@ CSpell * CSpellHandler::loadFromJson(const std::string & scope, const JsonNode & | |||||||
| 	{ | 	{ | ||||||
| 		if(counteredSpell.second.Bool()) | 		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)); | 				spell->counteredSpells.push_back(SpellID(id)); | ||||||
| 			}); | 			}); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user