浏览代码

Fixed game loading.
Release 0.75d

Michał W. Urbańczyk 15 年之前
父节点
当前提交
78f54ffcd3
共有 3 个文件被更改,包括 10 次插入3 次删除
  1. 1 0
      client/CPreGame.cpp
  2. 8 2
      client/Client.cpp
  3. 1 1
      client/GUIClasses.cpp

+ 1 - 0
client/CPreGame.cpp

@@ -570,6 +570,7 @@ void SelectionTab::parseGames(std::vector<FileInfo> &files)
 			tlog1 << files[i].name << " is not a correct savefile!" << std::endl;
 			continue;
 		}
+		allItems[i].mapHeader = new CMapHeader();
 		lf >> *(allItems[i].mapHeader) >> allItems[i].seldiff;
 		allItems[i].filename = files[i].name;
 		allItems[i].countPlayers();

+ 8 - 2
client/Client.cpp

@@ -175,6 +175,7 @@ void CClient::stop()
 	LOCPLINT->terminate_cond.setn(true);
 	LOCPLINT->pim->lock();
 	endGame();
+	tlog0 << "Client stopped." << std::endl;
 }
 
 void CClient::save(const std::string & fname)
@@ -195,12 +196,14 @@ void CClient::endGame()
 		GH.topInt()->deactivate();
 	GH.listInt.clear();
 	GH.objsToBlit.clear();
+	tlog0 << "Removed GUI." << std::endl;
 
 	delete CGI->mh;
 	CGI->mh = NULL;
 
 	delete CGI->state;
 	CGI->state = NULL;
+	tlog0 << "Deleted mapHandler and gameState." << std::endl;
 
 	LOCPLINT = NULL;
 	while (!playerint.empty())
@@ -213,13 +216,14 @@ void CClient::endGame()
 	{
 		delete cb;
 	}
+	tlog0 << "Deleted playerInts." << std::endl;
 
 	if (serv) 
 	{
-		tlog3 << "Connection has been requested to be closed.\n";
+		tlog0 << "Connection has been requested to be closed.\n";
 		boost::unique_lock<boost::mutex>(*serv->wmx);
 		*serv << &CloseServer();
-		tlog3 << "Sent closing signal to the server\n";
+		tlog0 << "Sent closing signal to the server\n";
 
 		serv->close();
 		delete serv;
@@ -228,6 +232,8 @@ void CClient::endGame()
 	}
 
 	connectionHandler->join();
+	tlog0 << "Connection handler thread joined" << std::endl;
+
 	delete connectionHandler;
 	connectionHandler = NULL;
 }

+ 1 - 1
client/GUIClasses.cpp

@@ -5065,4 +5065,4 @@ void MoraleLuckBox::set( bool morale, const CGHeroInstance *hero, int slot /*= -
 			for(int it=0; it < mrl.size(); it++)
 				text += "\n" + mrl[it].second;
 	}
-}
+}