summaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2004-09-19 18:23:11 +0000
committerdominik <dominik@openttd.org>2004-09-19 18:23:11 +0000
commita38e2d046acfb02da4c99b7b9db292c2e0007ab3 (patch)
tree2cf3ae5b4ab3b1c6a77c22100f0275f3238e1bac /sdl.c
parent6cad1071c803b3c53727edc80d2bc18b26313ae0 (diff)
downloadopenttd-a38e2d046acfb02da4c99b7b9db292c2e0007ab3.tar.xz
(svn r297) Fix (SDL): Added a confirmation dialog when quitting the game
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sdl.c b/sdl.c
index 7f04e26ab..a25725cbb 100644
--- a/sdl.c
+++ b/sdl.c
@@ -468,7 +468,12 @@ static int PollEvent() {
break;
case SDL_QUIT:
- return ML_QUIT;
+ // do not ask to quit on the main screen
+ if(_game_mode != GM_MENU)
+ AskExitGame();
+ else
+ return ML_QUIT;
+ break;
case SDL_KEYDOWN:
if ((((ev.key.keysym.sym == SDLK_RETURN) || (ev.key.keysym.sym == SDLK_f)) && (ev.key.keysym.mod & KMOD_ALT)) || (((ev.key.keysym.sym == SDLK_RETURN) || (ev.key.keysym.sym == SDLK_f)) && (ev.key.keysym.mod & KMOD_META))) {