hedgewars/uGame.pas
changeset 72 aeb2ac1878dc
parent 32 78bff13b11c0
child 74 42257fee61ae
--- a/hedgewars/uGame.pas	Wed Jun 28 18:27:42 2006 +0000
+++ b/hedgewars/uGame.pas	Thu Jun 29 18:27:53 2006 +0000
@@ -41,7 +41,7 @@
 ////////////////////
    implementation
 ////////////////////
-uses uMisc, uConsts, uWorld, uKeys, uTeams, uIO, uAI, uGears;
+uses uMisc, uConsts, uWorld, uKeys, uTeams, uIO, uAI, uGears, uConsole;
 
 procedure DoGameTick(Lag: integer);
 const SendEmptyPacketTicks: LongWord = 0;
@@ -63,7 +63,8 @@
    inc(SendEmptyPacketTicks, Lag)
    end;
 
-if Lag > 100 then Lag:= 100;
+if Lag > 100 then Lag:= 100
+else if GameType = gmtSave then Lag:= 1000;
 
 for i:= 1 to Lag do
     if not CurrentTeam.ExtDriven then
@@ -78,10 +79,15 @@
           case GameType of
                gmtNet: break;
                gmtDemo: begin
-                        SendIPC('q');
+                        ParseCommand('/quit');
                         GameState:= gsExit;
                         exit
-                        end
+                        end;
+               gmtSave: begin
+                        RestoreTeamsFromSave;
+                        isSoundEnabled:= isSEBackup;
+                        GameType:= gmtLocal
+                        end;
                end
           else ProcessGears
        end;