瀏覽代碼

Fix hero serialization

nordsoft 3 年之前
父節點
當前提交
bd32bd66b3
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      mapeditor/mapcontroller.cpp

+ 6 - 1
mapeditor/mapcontroller.cpp

@@ -128,10 +128,15 @@ void MapController::repairMap()
 			assert(type->heroClass);
 			assert(type->heroClass);
 			//TODO: find a way to get proper type name
 			//TODO: find a way to get proper type name
 			if(obj->ID == Obj::HERO)
 			if(obj->ID == Obj::HERO)
+			{
 				nih->typeName = "hero";
 				nih->typeName = "hero";
+				nih->subTypeName = type->heroClass->identifier;
+			}
 			if(obj->ID == Obj::PRISON)
 			if(obj->ID == Obj::PRISON)
+			{
 				nih->typeName = "prison";
 				nih->typeName = "prison";
-			nih->subTypeName = type->heroClass->identifier;
+				nih->subTypeName = "prison";
+			}
 			
 			
 			nih->type = type;
 			nih->type = type;
 			if(nih->name.empty())
 			if(nih->name.empty())