diff --git a/lib/mapping/MapIdentifiersH3M.cpp b/lib/mapping/MapIdentifiersH3M.cpp index 5e9f4f95b..947751d78 100644 --- a/lib/mapping/MapIdentifiersH3M.cpp +++ b/lib/mapping/MapIdentifiersH3M.cpp @@ -116,6 +116,15 @@ void MapIdentifiersH3M::remapTemplate(ObjectTemplate & objectTemplate) objectTemplate.subid = mappedType.subID; } + if (objectTemplate.id == Obj::TOWN || objectTemplate.id == Obj::RANDOM_DWELLING_FACTION) + objectTemplate.subid = remap(FactionID(objectTemplate.subid)); + + if (objectTemplate.id == Obj::MONSTER) + objectTemplate.subid = remap(CreatureID(objectTemplate.subid)); + + if (objectTemplate.id == Obj::ARTIFACT) + objectTemplate.subid = remap(ArtifactID(objectTemplate.subid)); + if (VLC->objtypeh->knownObjects().count(objectTemplate.id) == 0) { logGlobal->warn("Unknown object found: %d | %d", objectTemplate.id, objectTemplate.subid); @@ -131,15 +140,6 @@ void MapIdentifiersH3M::remapTemplate(ObjectTemplate & objectTemplate) objectTemplate.subid = {}; } } - - if (objectTemplate.id == Obj::TOWN || objectTemplate.id == Obj::RANDOM_DWELLING_FACTION) - objectTemplate.subid = remap(FactionID(objectTemplate.subid)); - - if (objectTemplate.id == Obj::MONSTER) - objectTemplate.subid = remap(CreatureID(objectTemplate.subid)); - - if (objectTemplate.id == Obj::ARTIFACT) - objectTemplate.subid = remap(ArtifactID(objectTemplate.subid)); } BuildingID MapIdentifiersH3M::remapBuilding(std::optional owner, BuildingID input) const