hedgewars/GSHandlers.inc
changeset 83 207c85fbef51
parent 82 2f4f3236cccc
child 89 f9db56409a86
--- a/hedgewars/GSHandlers.inc	Sun Jul 23 21:22:44 2006 +0000
+++ b/hedgewars/GSHandlers.inc	Mon Jul 24 14:03:51 2006 +0000
@@ -318,24 +318,28 @@
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepActionTimer(Gear: PGear);
 begin
-case Gear.State of
-     gtsStartGame: begin
-                   dec(Gear.Timer);
+dec(Gear.Timer);
+case Gear.Kind of
+    gtATStartGame: begin
                    AllInactive:= false;
-                   if Gear.Timer > 0 then exit;
-                   AddCaption(trmsg[sidStartFight], $FFFFFF, capgrpStartGame);
-                   DeleteGear(Gear)
+                   if Gear.Timer = 0 then
+                      AddCaption(trmsg[sidStartFight], $FFFFFF, capgrpGameState);
                    end;
-  gtsSmoothWindCh: begin
+ gtATSmoothWindCh: begin
                    if Gear.Timer = 0 then
                       begin
-                      Gear.Timer:= 10;
                       if WindBarWidth < Gear.Tag then inc(WindBarWidth)
-                         else if WindBarWidth > Gear.Tag then dec(WindBarWidth)
-                         else DeleteGear(Gear)
-                      end else dec(Gear.Timer)
+                         else if WindBarWidth > Gear.Tag then dec(WindBarWidth);
+                      if WindBarWidth <> Gear.Tag then Gear.Timer:= 10;
+                      end
+                   end;
+   gtATFinishGame: begin
+                   AllInactive:= false;
+                   if Gear.Timer = 0 then
+                      GameState:= gsExit
                    end;
      end;
+if Gear.Timer = 0 then DeleteGear(Gear)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////