1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-09 07:13:54 +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
commit 3e87d9e5fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<FactionID> owner, BuildingID input) const