X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=d6c84d81a4495eb03e19eedd99ae849bfc2c4cf2;hb=0078fa1620abed262370083c0c6aa475a25e1b04;hp=ed616df1d60504fc5a5245d0951484ae2d6afec8;hpb=002c075b9935dc5dc055d3a8f35b2774796fa1c4;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index ed616df1..d6c84d81 100644 --- a/src/screens.c +++ b/src/screens.c @@ -2953,11 +2953,44 @@ void HandleGameActions() byte tape_action[MAX_PLAYERS]; int i; + if (level.native_em_level->lev->home == 0) /* all players at home */ + { + GameWon(); + + if (!TAPE_IS_STOPPED(tape)) + TapeStop(); + + if (game_status != GAME_MODE_PLAYING) + return; + } + + if (level.native_em_level->ply1->alive == 0 && + level.native_em_level->ply2->alive == 0) /* all dead */ + AllPlayersGone = TRUE; + + if (AllPlayersGone && !TAPE_IS_STOPPED(tape)) + TapeStop(); + + /* --- game actions --- */ + if (tape.pausing) + { + /* don't use 100% CPU while in pause mode -- this should better be solved + like in the R'n'D game engine! */ + + Delay(10); + return; + } recorded_player_action = (tape.playing ? TapePlayAction() : NULL); +#if 1 + /* !!! CHECK THIS (tape.pausing is always FALSE here!) !!! */ + if (recorded_player_action == NULL && tape.pausing) + return; +#endif + for (i = 0; i < MAX_PLAYERS; i++) { summarized_player_action |= stored_player[i].action; @@ -2997,6 +3030,7 @@ void HandleGameActions() DrawVideoDisplay(VIDEO_STATE_TIME_ON, TapeTime); } + FrameCounter++; TimeFrames++; BackToFront();