Fixed Neverputt pause sometimes using itself as the "continue" state.
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sun, 25 Nov 2007 23:27:54 +0000 (23:27 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sun, 25 Nov 2007 23:27:54 +0000 (23:27 +0000)
We simply make sure that the "continue" state is never the pause state
itself.  This can  happen  if  game window  loses  focus  -- and  thus
goto_pause is called -- while the pause state is active.

Call it a hack.

git-svn-id: https://s.snth.net/svn/neverball/trunk@1225 78b8d119-cf0a-0410-b17c-f493084dd1d7

putt/st_all.c

index fe2fd68..be00fe9 100644 (file)
@@ -525,6 +525,9 @@ static struct state *st_quit;
 
 int goto_pause(struct state *s, int e)
 {
+    if (curr_state() == &st_pause)
+        return 1;
+
     if (e && (SDL_GetModState() & KMOD_SHIFT))
         return goto_state(s);