Various small insignificant improvements everywhere
authorunc0rr
Wed, 15 Oct 2008 11:50:16 +0000 (2008-10-15)
changeset 1354 a8dcdeb88a43
parent 1353 c72d37d4eb4e
child 1355 8e167aa3b2e4
Various small insignificant improvements everywhere
QTfrontend/hwform.cpp
QTfrontend/hwform.h
QTfrontend/newnetclient.cpp
hedgewars.kdevelop
hedgewars/uTeams.pas
netserver/HWProto.hs
--- a/QTfrontend/hwform.cpp	Tue Oct 14 14:35:52 2008 +0000
+++ b/QTfrontend/hwform.cpp	Wed Oct 15 11:50:16 2008 +0000
@@ -257,7 +257,7 @@
 
 void HWForm::OnPageShown(quint8 id, quint8 lastid)
 {
-	if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETCFG) {
+	if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETGAME) {
 		QStringList tmNames = config->GetTeamsList();
 		TeamSelWidget* curTeamSelWidget;
 		
@@ -282,9 +282,6 @@
 		  curTeamSelWidget->resetPlayingTeams(teamsList);
 		}
 	}
-
-	if (id == ID_PAGE_ROOMSLIST && lastid == ID_PAGE_NETCFG)
-		GoBack();
 }
 
 void HWForm::GoToPage(quint8 id)
@@ -297,13 +294,15 @@
 
 void HWForm::GoBack()
 {
-	if (!PagesStack.isEmpty() && PagesStack.top() == ID_PAGE_NET) {
-		if(hwnet || pnetserver) NetDisconnect();
-	}
 	quint8 id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop();
 	quint8 curid = ui.Pages->currentIndex();
 	ui.Pages->setCurrentIndex(id);
 	OnPageShown(id, curid);
+	
+	if (id == ID_PAGE_ROOMSLIST) {
+		if(hwnet || pnetserver) NetDisconnect();
+		GoBack();
+	}
 }
 
 void HWForm::btnExitPressed()
@@ -509,7 +508,7 @@
   if(hwnet) {
     hwnet->Disconnect();
     delete hwnet;
-    hwnet=0;
+    hwnet = 0;
   }
   if(pnetserver) {
     if (pRegisterServer)
@@ -543,7 +542,7 @@
 
 void HWForm::NetGameEnter()
 {
-	GoToPage(ID_PAGE_NETCFG);
+	GoToPage(ID_PAGE_NETGAME);
 }
 
 void HWForm::NetStartGame()
--- a/QTfrontend/hwform.h	Tue Oct 14 14:35:52 2008 +0000
+++ b/QTfrontend/hwform.h	Wed Oct 15 11:50:16 2008 +0000
@@ -99,7 +99,7 @@
 		ID_PAGE_MULTIPLAYER     =  2,
 		ID_PAGE_DEMOS           =  3,
 		ID_PAGE_NET             =  4,
-		ID_PAGE_NETCFG          =  5,
+		ID_PAGE_NETGAME         =  5,
 		ID_PAGE_INFO            =  6,
 		ID_PAGE_MAIN            =  7,
 		ID_PAGE_GAMESTATS       =  8,
--- a/QTfrontend/newnetclient.cpp	Tue Oct 14 14:35:52 2008 +0000
+++ b/QTfrontend/newnetclient.cpp	Wed Oct 15 11:50:16 2008 +0000
@@ -53,8 +53,10 @@
 
 void HWNewNet::Disconnect()
 {
-  m_game_connected = false;
-  NetSocket.disconnectFromHost();
+	if (m_game_connected)
+		RawSendNet(QString("QUIT"));
+	m_game_connected = false;
+	NetSocket.disconnectFromHost();
 }
 
 void HWNewNet::CreateRoom(const QString & room)
@@ -158,7 +160,7 @@
 {
   //emit ChangeInTeams(QStringList());
   if(m_game_connected) emit Disconnected();
-  m_game_connected=false;
+  m_game_connected = false;
 }
 
 void HWNewNet::displayError(QAbstractSocket::SocketError socketError)
--- a/hedgewars.kdevelop	Tue Oct 14 14:35:52 2008 +0000
+++ b/hedgewars.kdevelop	Wed Oct 15 11:50:16 2008 +0000
@@ -213,7 +213,7 @@
       <hidenonlocation>false</hidenonlocation>
     </groups>
     <tree>
-      <hidepatterns></hidepatterns>
+      <hidepatterns/>
       <hidenonprojectfiles>true</hidenonprojectfiles>
       <showvcsfields>false</showvcsfields>
     </tree>
--- a/hedgewars/uTeams.pas	Tue Oct 14 14:35:52 2008 +0000
+++ b/hedgewars/uTeams.pas	Wed Oct 15 11:50:16 2008 +0000
@@ -370,7 +370,9 @@
 with TeamsArray[i]^ do
 	begin
 	AddChatString('* '+ TeamName + ' is gone');
-	//for i:= 0 to cMaxHHIndex do Hedgehogs[i].Gear:= nil;
+	for i:= 0 to cMaxHHIndex do
+		with Hedgehogs[i] do
+			Gear^.State:= Gear^.State and not gstHHDriven;
 	hasGone:= true
 	end
 end;
--- a/netserver/HWProto.hs	Tue Oct 14 14:35:52 2008 +0000
+++ b/netserver/HWProto.hs	Wed Oct 15 11:50:16 2008 +0000
@@ -122,7 +122,7 @@
 	else if roomPassword /= password clRoom then
 		(noChangeClients, noChangeRooms, answerWrongPassword)
 	else
-		(modifyClient client{room = roomName}, noChangeRooms, (answerJoined $ nick client) ++ answerNicks ++ answerFullConfig clRoom ++ answerAllTeams clRoom)
+		(modifyClient client{room = roomName}, noChangeRooms, answerNicks ++ (answerJoined $ nick client) ++ answerFullConfig clRoom ++ answerAllTeams clRoom)
 	where
 		noSuchRoom = isNothing $ find (\room -> roomName == name room) rooms
 		answerNicks = [(clientOnly, ["JOINED"] ++ (map nick $ filter (\ci -> room ci == roomName) clients))]