Properly handle room deletion in respect of pages switching
authorunc0rr
Wed, 14 Jan 2009 16:51:55 +0000
changeset 1672 6a451649558c
parent 1671 bb12cb688f75
child 1673 06bff12f8a74
Properly handle room deletion in respect of pages switching
QTfrontend/hwform.cpp
--- a/QTfrontend/hwform.cpp	Wed Jan 14 16:49:44 2009 +0000
+++ b/QTfrontend/hwform.cpp	Wed Jan 14 16:51:55 2009 +0000
@@ -320,9 +320,15 @@
 	ui.Pages->setCurrentIndex(id);
 	OnPageShown(id, curid);
 	
-	if (id == ID_PAGE_NETSERVER || (id == ID_PAGE_ROOMSLIST && !hwnet)) {
+	if (id == ID_PAGE_NETSERVER)
+		GoBack();
+	if ((!hwnet) && (id == ID_PAGE_ROOMSLIST))
 		GoBack();
-	}
+	
+	if ((!hwnet) || (!hwnet->isInRoom()))
+		if (id == ID_PAGE_NETGAME || id == ID_PAGE_NETGAME)
+			GoBack();
+
 	if (id == ID_PAGE_NET) {
 		if(hwnet || pnetserver) NetDisconnect();
 	}