hedgewars/hwengine.pas
changeset 9028 3a38c9453697
parent 8948 c8a6f789398d
child 9080 9b42757d7e71
--- a/hedgewars/hwengine.pas	Tue May 21 21:22:32 2013 +0400
+++ b/hedgewars/hwengine.pas	Tue May 21 21:30:42 2013 +0400
@@ -93,13 +93,7 @@
             ScriptCall('onGameStart');
             GameState:= gsGame;
             end;
-        gsConfirm, gsGame:
-            begin
-            if not cOnlyStats then DrawWorld(Lag);
-            DoGameTick(Lag);
-            if not cOnlyStats then ProcessVisualGears(Lag);
-            end;
-        gsChat:
+        gsConfirm, gsGame, gsChat:
             begin
             if not cOnlyStats then DrawWorld(Lag);
             DoGameTick(Lag);
@@ -168,10 +162,10 @@
                     // sdl on iphone supports only ashii keyboards and the unicode field is deprecated in sdl 1.3
                         KeyPressChat(SDL_GetKeyFromScancode(event.key.keysym.sym), event.key.keysym.sym); //TODO correct for keymodifiers
                         end
-                    else
-                        ProcessKey(event.key);
+                    else 
+                        if GameState >= gsGame then ProcessKey(event.key);
                 SDL_KEYUP:
-                    if GameState <> gsChat then
+                    if (GameState <> gsChat) and (GameState >= gsGame) then
                         ProcessKey(event.key);
 
                 SDL_WINDOWEVENT:
@@ -213,19 +207,19 @@
                     if GameState = gsChat then
                         KeyPressChat(event.key.keysym.unicode, event.key.keysym.sym)
                     else
-                        ProcessKey(event.key);
+                        if GameState >= gsGame then ProcessKey(event.key);
                 SDL_KEYUP:
-                    if GameState <> gsChat then
+                    if (GameState <> gsChat) and (GameState >= gsGame) then
                         ProcessKey(event.key);
 
                 SDL_MOUSEBUTTONDOWN:
                     if GameState = gsConfirm then
                         ParseCommand('quit', true)
                     else
-                        ProcessMouse(event.button, true);
+                        if (GameState >= gsGame) then ProcessMouse(event.button, true);
 
                 SDL_MOUSEBUTTONUP:
-                    ProcessMouse(event.button, false);
+                    if (GameState >= gsGame) then ProcessMouse(event.button, false);
 
                 SDL_ACTIVEEVENT:
                     if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then