1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fixes identifiers resolving for json serialization

This commit is contained in:
Ivan Savenko
2022-12-06 16:26:32 +02:00
parent 34cd856f53
commit 65f9a1ffd2
2 changed files with 10 additions and 7 deletions

View File

@@ -86,7 +86,7 @@ const Artifact * ArtifactID::toArtifact(const ArtifactService * service) const
si32 ArtifactID::decode(const std::string & identifier)
{
auto rawId = VLC->modh->identifiers.getIdentifier("core", "artifact", identifier);
auto rawId = VLC->modh->identifiers.getIdentifier("map", "artifact", identifier);
if(rawId)
return rawId.get();
else
@@ -110,7 +110,7 @@ const Creature * CreatureID::toCreature(const CreatureService * creatures) const
si32 CreatureID::decode(const std::string & identifier)
{
auto rawId = VLC->modh->identifiers.getIdentifier("core", "creature", identifier);
auto rawId = VLC->modh->identifiers.getIdentifier("map", "creature", identifier);
if(rawId)
return rawId.get();
else
@@ -139,7 +139,7 @@ const spells::Spell * SpellID::toSpell(const spells::Service * service) const
si32 SpellID::decode(const std::string & identifier)
{
auto rawId = VLC->modh->identifiers.getIdentifier("core", "spell", identifier);
auto rawId = VLC->modh->identifiers.getIdentifier("map", "spell", identifier);
if(rawId)
return rawId.get();
else
@@ -201,7 +201,7 @@ const FactionID FactionID::NEUTRAL = FactionID(9);
si32 FactionID::decode(const std::string & identifier)
{
auto rawId = VLC->modh->identifiers.getIdentifier("core", "faction", identifier);
auto rawId = VLC->modh->identifiers.getIdentifier("map", "faction", identifier);
if(rawId)
return rawId.get();
else