소스 검색

Fix mapping of map objects linked to game entities

Ivan Savenko 2 년 전
부모
커밋
d742b6b809
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      lib/mapping/MapIdentifiersH3M.cpp

+ 9 - 0
lib/mapping/MapIdentifiersH3M.cpp

@@ -111,6 +111,15 @@ void MapIdentifiersH3M::remapTemplate(ObjectTemplate & objectTemplate)
 		objectTemplate.id = mappedType.ID;
 		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));
 }
 
 BuildingID MapIdentifiersH3M::remapBuilding(std::optional<FactionID> owner, BuildingID input) const