1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-08 22:26:51 +02:00

Merge pull request #5407 from IvanSavenko/cove_fix

[1.6.6] Fix loading of HotA maps with Cove town placed on map
This commit is contained in:
Ivan Savenko
2025-02-10 14:52:44 +02:00
committed by GitHub

View File

@@ -116,6 +116,15 @@ void MapIdentifiersH3M::remapTemplate(ObjectTemplate & objectTemplate)
objectTemplate.subid = mappedType.subID; 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) if (VLC->objtypeh->knownObjects().count(objectTemplate.id) == 0)
{ {
logGlobal->warn("Unknown object found: %d | %d", objectTemplate.id, objectTemplate.subid); logGlobal->warn("Unknown object found: %d | %d", objectTemplate.id, objectTemplate.subid);
@@ -131,15 +140,6 @@ void MapIdentifiersH3M::remapTemplate(ObjectTemplate & objectTemplate)
objectTemplate.subid = {}; 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<FactionID> owner, BuildingID input) const BuildingID MapIdentifiersH3M::remapBuilding(std::optional<FactionID> owner, BuildingID input) const