projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed lists of setup token names that were not really needed at all
[rocksndiamonds.git]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index 71740a8f4931186bbcd5a08847518cef733528d5..6463df1b976f65ad72cec76db6253daf99917944 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-3358,7
+3358,7
@@
void InitGame(void)
else
FadeSetEnterScreen();
else
FadeSetEnterScreen();
- if (Check
IfGlobalBorderOrPlayfieldViewportHasChanged
())
+ if (Check
FadeAll
())
fade_mask = REDRAW_ALL;
FadeLevelSoundsAndMusic();
fade_mask = REDRAW_ALL;
FadeLevelSoundsAndMusic();
@@
-3566,6
+3566,8
@@
void InitGame(void)
game.LevelSolved = FALSE;
game.GameOver = FALSE;
game.LevelSolved = FALSE;
game.GameOver = FALSE;
+ game.GamePlayed = !tape.playing;
+
game.LevelSolved_GameWon = FALSE;
game.LevelSolved_GameEnd = FALSE;
game.LevelSolved_SaveTape = FALSE;
game.LevelSolved_GameWon = FALSE;
game.LevelSolved_GameEnd = FALSE;
game.LevelSolved_SaveTape = FALSE;
@@
-4501,7
+4503,7
@@
void GameWon(void)
int i;
// do not start end game actions before the player stops moving (to exit)
int i;
// do not start end game actions before the player stops moving (to exit)
- if (local_player->MovPos)
+ if (local_player->
active && local_player->
MovPos)
return;
game.LevelSolved_GameWon = TRUE;
return;
game.LevelSolved_GameWon = TRUE;
@@
-11483,6
+11485,10
@@
static void GameActionsExt(void)
if (tape.recording)
TapeRecordAction(tape_action);
if (tape.recording)
TapeRecordAction(tape_action);
+ // remember if game was played (especially after tape stopped playing)
+ if (!tape.playing && summarized_player_action)
+ game.GamePlayed = TRUE;
+
#if USE_NEW_PLAYER_ASSIGNMENTS
// !!! also map player actions in single player mode !!!
// if (game.team_mode)
#if USE_NEW_PLAYER_ASSIGNMENTS
// !!! also map player actions in single player mode !!!
// if (game.team_mode)
@@
-12158,7
+12164,8
@@
void GameActions_RND(void)
DrawAllPlayers();
PlayAllPlayersSound();
DrawAllPlayers();
PlayAllPlayersSound();
- if (local_player->show_envelope != 0 && local_player->MovPos == 0)
+ if (local_player->show_envelope != 0 && (!local_player->active ||
+ local_player->MovPos == 0))
{
ShowEnvelope(local_player->show_envelope - EL_ENVELOPE_1);
{
ShowEnvelope(local_player->show_envelope - EL_ENVELOPE_1);
@@
-13445,6
+13452,9
@@
void RemovePlayer(struct PlayerInfo *player)
player->present = FALSE;
player->active = FALSE;
player->present = FALSE;
player->active = FALSE;
+ // required for some CE actions (even if the player is not active anymore)
+ player->MovPos = 0;
+
if (!ExplodeField[jx][jy])
StorePlayer[jx][jy] = 0;
if (!ExplodeField[jx][jy])
StorePlayer[jx][jy] = 0;
@@
-14967,7
+14977,12
@@
void RequestQuitGameExt(boolean skip_request, boolean quick_quit, char *message)
{
// closing door required in case of envelope style request dialogs
if (!skip_request)
{
// closing door required in case of envelope style request dialogs
if (!skip_request)
+ {
+ // prevent short reactivation of overlay buttons while closing door
+ SetOverlayActive(FALSE);
+
CloseDoor(DOOR_CLOSE_1);
CloseDoor(DOOR_CLOSE_1);
+ }
if (network.enabled)
SendToServer_StopPlaying(NETWORK_STOP_BY_PLAYER);
if (network.enabled)
SendToServer_StopPlaying(NETWORK_STOP_BY_PLAYER);
@@
-15032,6
+15047,10
@@
void CheckGameOver(void)
if (game.request_active)
return;
if (game.request_active)
return;
+ // do not ask to play again if game was never actually played
+ if (!game.GamePlayed)
+ return;
+
if (!game_over)
{
last_game_over = FALSE;
if (!game_over)
{
last_game_over = FALSE;