浏览代码

Fix crash on loading town with unit that has ability propagated to army

Ivan Savenko 2 月之前
父节点
当前提交
760eff8139
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      lib/mapping/MapFormatH3M.cpp

+ 3 - 0
lib/mapping/MapFormatH3M.cpp

@@ -2474,7 +2474,10 @@ std::shared_ptr<CGObjectInstance> CMapLoaderH3M::readTown(const int3 & position,
 
 	std::optional<FactionID> faction;
 	if (objectTemplate->id == Obj::TOWN)
+	{
 		faction = FactionID(objectTemplate->subid);
+		object->subID = objectTemplate->subid;
+	}
 
 	bool hasName = reader->readBool();
 	if(hasName)