2
0
Эх сурвалжийг харах

- missing fields in town serialization

Ivan Savenko 13 жил өмнө
parent
commit
23fcdd1a4a

+ 1 - 3
client/BattleInterface/CBattleInterface.cpp

@@ -3585,10 +3585,8 @@ std::string CBattleInterface::SiegeHelper::getSiegeName(ui16 what, ui16 additInf
 			{
 			case 5: case 4: case 1: case 6:
 				return prefix + "TPW1.BMP";
-			case 0: case 2: case 3: case 7: case 8:
-				return prefix + "TPWL.BMP";
 			default:
-				return "";
+				return prefix + "TPWL.BMP";
 			}
 		}
 	case 2: //keep

+ 2 - 6
client/GUIClasses.cpp

@@ -5326,16 +5326,12 @@ CUniversityWindow::CUniversityWindow(const CGHeroInstance * _hero, const IMarket
 
 	CIntObject * titlePic = nullptr;
 
-	if ( market->o->ID == Obj::UNIVERSITY ) // this is adventure map university
-		titlePic = new CPicture("UNIVBLDG");
-	else
 	if (market->o->ID == Obj::TOWN)
 		titlePic = new CAnimImage(CGI->townh->towns[ETownType::CONFLUX].clientInfo.buildingsIcons, EBuilding::MAGIC_UNIVERSITY);
 	else
-		tlog0<<"Error: Image for university was not found!\n";//This should not happen
+		titlePic = new CPicture("UNIVBLDG");
 
-	if (titlePic)
-		titlePic->center(Point(232 + pos.x, 76 + pos.y));
+	titlePic->center(Point(232 + pos.x, 76 + pos.y));
 
 	//Clerk speech
 	new CTextBox(CGI->generaltexth->allTexts[603], Rect(24, 129, 413, 70), 0, FONT_SMALL, CENTER, Colors::WHITE);

+ 1 - 0
lib/CGameState.cpp

@@ -1344,6 +1344,7 @@ void CGameState::init(StartInfo * si)
 	}
 	/****************************TOWNS************************************************/
 	tlog4 << "\tTowns";
+	CGTownInstance::universitySkills.clear();
 	for ( int i=0; i<4; i++)
 		CGTownInstance::universitySkills.push_back(14+i);//skills for university
 

+ 10 - 1
lib/CTownHandler.h

@@ -102,7 +102,14 @@ public:
 	// Client-only data. Should be moved away from lib
 	struct ClientInfo
 	{
-		struct Point { si32 x; si32 y;};
+		struct Point
+		{
+			si32 x;
+			si32 y;
+
+			template <typename Handler> void serialize(Handler &h, const int version)
+			{ h & x & y; }
+		};
 
 		//icons [fort is present?][build limit reached?] -> index of icon in def files
 		int icons[2][2];
@@ -131,6 +138,8 @@ public:
 		template <typename Handler> void serialize(Handler &h, const int version)
 		{
 			h & icons & musicTheme & townBackground & guildWindow & buildingsIcons & hallBackground & hallSlots & structures;
+			h & advMapVillage & advMapCastle & advMapCapitol;
+			h & siegePrefix & siegePositions & siegeShooter & siegeShooterCropHeight;
 		}
 	} clientInfo;
 

+ 1 - 0
lib/Map/CMap.h

@@ -827,6 +827,7 @@ public:
 		h & CGMagi::eyelist;
 		h & CGObelisk::obeliskCount & CGObelisk::visited;
 		h & CGTownInstance::merchantArtifacts;
+		h & CGTownInstance::universitySkills;
 
 		if(!h.saving)
 		{