projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added support for level color settings in BD engine to level editor
[rocksndiamonds.git]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index 2c16aa62c93d95c8a5344eb9f5d44aea92955c54..506def33ce0682ae91f3903b2802715300dcba56 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-4621,6
+4621,7
@@
void InitGame(void)
game.restart_level = FALSE;
game.request_active = FALSE;
game.envelope_active = FALSE;
game.restart_level = FALSE;
game.request_active = FALSE;
game.envelope_active = FALSE;
+ game.any_door_active = FALSE;
if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
InitGameActions_MM();
if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
InitGameActions_MM();
@@
-5160,10
+5161,19
@@
void GameEnd(void)
// used instead of "level_nr" (needed for network games)
int last_level_nr = levelset.level_nr;
boolean tape_saved = FALSE;
// used instead of "level_nr" (needed for network games)
int last_level_nr = levelset.level_nr;
boolean tape_saved = FALSE;
+ boolean game_over = checkGameFailed();
// Important note: This function is not only called after "GameWon()", but also after
// "game over" (if automatically asking for restarting the game is disabled in setup)
// Important note: This function is not only called after "GameWon()", but also after
// "game over" (if automatically asking for restarting the game is disabled in setup)
+ // do not handle game end if game over and automatically asking for game restart
+ if (game_over && setup.ask_on_game_over)
+ return;
+
+ // do not handle game end if request dialog is already active
+ if (checkRequestActive())
+ return;
+
if (game.LevelSolved)
game.LevelSolved_GameEnd = TRUE;
if (game.LevelSolved)
game.LevelSolved_GameEnd = TRUE;
@@
-16342,7
+16352,7
@@
boolean CheckRestartGame(void)
}
// do not ask to play again if request dialog is already active
}
// do not ask to play again if request dialog is already active
- if (
game.request_active
)
+ if (
checkRequestActive()
)
return FALSE;
// do not ask to play again if request dialog already handled
return FALSE;
// do not ask to play again if request dialog already handled
@@
-16411,6
+16421,11
@@
boolean checkGameEnded(void)
return (checkGameSolved() || checkGameFailed());
}
return (checkGameSolved() || checkGameFailed());
}
+boolean checkRequestActive(void)
+{
+ return (game.request_active || game.envelope_active || game.any_door_active);
+}
+
// ----------------------------------------------------------------------------
// random generator functions
// ----------------------------------------------------------------------------
// random generator functions