hedgewars/hwengine.pas
changeset 3449 033e4a8a9c74
parent 3444 9d501dc22f71
child 3463 23c50be687a9
--- a/hedgewars/hwengine.pas	Fri May 07 20:38:55 2010 +0000
+++ b/hedgewars/hwengine.pas	Fri May 07 20:45:03 2010 +0000
@@ -90,7 +90,7 @@
 var s: shortstring;
 {$ENDIF}
 begin
-    inc(RealTicks, Lag);
+    if not isPaused then inc(RealTicks, Lag);
 
     case GameState of
         gsLandGen: begin
@@ -121,13 +121,19 @@
         gsGame: begin
                 DrawWorld(Lag); // never place between ProcessKbd and DoGameTick - bugs due to /put cmd and isCursorVisible
                 ProcessKbd;
-                DoGameTick(Lag);
-                if not isPaused then ProcessVisualGears(Lag);
+                if not isPaused then
+                    begin
+                    DoGameTick(Lag);
+                    ProcessVisualGears(Lag);
+                    end;
                 end;
         gsChat: begin
                 DrawWorld(Lag);
-                DoGameTick(Lag);
-                ProcessVisualGears(Lag);
+                if not isPaused then
+                    begin
+                    DoGameTick(Lag);
+                    ProcessVisualGears(Lag);
+                    end;
                 end;
         gsExit: begin
                 isTerminated:= true;
@@ -156,6 +162,7 @@
 begin
     WriteLnToConsole('Freeing resources...');
     if isSoundEnabled then ReleaseSound();
+    FreeActionsList();
     StoreRelease();
     FreeGearsList();
     FreeVisualGears();