QTfrontend/game.cpp
changeset 5865 35387d27f73a
parent 5781 1fa54e5ea479
child 6015 daffc14a518a
--- a/QTfrontend/game.cpp	Sun Sep 11 13:21:50 2011 -0400
+++ b/QTfrontend/game.cpp	Sun Sep 11 21:45:28 2011 +0400
@@ -53,8 +53,13 @@
 void HWGame::onClientDisconnect()
 {
     switch (gameType) {
-        case gtDemo: 
-            if (gameState == gsInterrupted || gameState == gsHalted) emit HaveRecord(false, demo);
+        case gtSave:
+            if (gameState == gsInterrupted || gameState == gsHalted)
+                emit HaveRecord(false, demo);
+            else if (gameState == gsFinished)
+                 emit HaveRecord(true, demo);
+            break;
+        case gtDemo:
             break;
         case gtNet:
             emit HaveRecord(true, demo);
@@ -188,6 +193,7 @@
                     SendQuickConfig();
                     break;
                 }
+                case gtSave:
                 case gtDemo: break;
                 case gtNet: {
                     SendNetConfig();
@@ -321,9 +327,9 @@
     TeamCount++;
 }
 
-void HWGame::PlayDemo(const QString & demofilename)
+void HWGame::PlayDemo(const QString & demofilename, bool isSave)
 {
-    gameType = gtDemo;
+    gameType = isSave ? gtSave : gtDemo;
     QFile demofile(demofilename);
     if (!demofile.open(QIODevice::ReadOnly))
     {