X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=425c35e86f014dfbc4c079166e7bb76c1d7ccdd7;hb=cee436b68cda95e13abc810235a11ce94bc79c95;hp=9211c573411b2121b8897fa377786898cdfc180d;hpb=9c43bda51b4cc085fe9c2770c1e45fbce104412a;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index 9211c573..425c35e8 100644 --- a/src/screens.c +++ b/src/screens.c @@ -501,13 +501,9 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) else #endif { -#if 1 - em_main(); -#else game_status = GAME_MODE_PLAYING; StopAnimation(); InitGame(); -#endif } } else if (y == 6) @@ -2948,17 +2944,35 @@ void HandleGameActions() if (game_status != GAME_MODE_PLAYING) return; - if (local_player->LevelSolved) - GameWon(); + /* !!! FIX THIS (START) !!! */ + if (level.file_info.type == LEVEL_FILE_TYPE_EM) + { + byte summarized_player_action = 0; + int i; - if (AllPlayersGone && !TAPE_IS_STOPPED(tape)) - TapeStop(); + for (i = 0; i < MAX_PLAYERS; i++) + summarized_player_action |= stored_player[i].action; - GameActions(); - BackToFront(); + if (em_main_handle_game(summarized_player_action) != 0) + { + game_status = GAME_MODE_MAIN; + DrawMainMenu(); + } + } + else + { + if (local_player->LevelSolved) + GameWon(); - if (tape.auto_play && !tape.playing) - AutoPlayTape(); /* continue automatically playing next tape */ + if (AllPlayersGone && !TAPE_IS_STOPPED(tape)) + TapeStop(); + + GameActions(); + BackToFront(); + + if (tape.auto_play && !tape.playing) + AutoPlayTape(); /* continue automatically playing next tape */ + } } /* ---------- new screen button stuff -------------------------------------- */