# HG changeset patch # User unc0rr # Date 1369157442 -14400 # Node ID 3a38c945369753a2c948d632ab50e6abecfe955f # Parent 4b8e326251b37b31bb715fa124efcab5a7eb54fb Don't accept keyboard/mouse events on startup phase diff -r 4b8e326251b3 -r 3a38c9453697 hedgewars/hwengine.pas --- 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