summaryrefslogtreecommitdiffstats
path: root/HTanks.hs
diff options
context:
space:
mode:
Diffstat (limited to 'HTanks.hs')
-rw-r--r--HTanks.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/HTanks.hs b/HTanks.hs
index 1bbae03..c27cb81 100644
--- a/HTanks.hs
+++ b/HTanks.hs
@@ -164,7 +164,8 @@ simulationStep = do
handleEvents :: Main ()
handleEvents = do
- event <- gets driver >>= liftIO . nextEvent
+ (newgl, event) <- gets driver >>= liftIO . nextEvent
+ modify $ \state -> state {driver = newgl}
when (isJust event) $ do
Main.handleEvent $ fromJust event
modify $ \state -> state {players = map (\p -> Player.handleEvent p $ fromJust event) $ players state}