Browse Source

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

Ivan Savenko 2 months ago
parent
commit
760eff8139
1 changed files with 3 additions and 0 deletions
  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)