X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=1b3de85223f0565546111589206ae7b4a1e387b8;hb=d14ff3d04c44d90b4dc151fd7774946e20da0152;hp=999e933ea408dc2e322386f679ce2b33f7eb40a9;hpb=88c9b68c44a16e7df62557b63cc7e86731e028c9;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index 999e933e..1b3de852 100644 --- a/src/screens.c +++ b/src/screens.c @@ -452,6 +452,11 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) { if (dx && choice == 1) x = (dx < 0 ? 10 : 14); + else if (dx > 0) + { + if (choice == 4 || choice == 6) + button = MB_MENU_CHOICE; + } else if (dy) y = choice + dy; } @@ -821,12 +826,15 @@ void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init) action = helpanim_info[j].action; direction = helpanim_info[j].direction; + if (element < 0) + element = EL_UNKNOWN; + if (action != -1 && direction != -1) graphic = el_act_dir2img(element, action, direction); else if (action != -1) graphic = el_act2img(element, action); else if (direction != -1) - graphic = el_act2img(element, direction); + graphic = el_dir2img(element, direction); else graphic = el2img(element); @@ -995,7 +1003,7 @@ void HandleInfoScreen_Elements(int button) } else { - if (DelayReached(&info_delay, GAME_FRAME_DELAY)) + if (DelayReached(&info_delay, GameFrameDelay)) if (page < num_pages) DrawInfoScreen_HelpAnim(page * anims_per_page, num_anims, FALSE); @@ -3080,16 +3088,36 @@ void HandleGameActions() byte tape_action[MAX_PLAYERS]; int i; +#if 1 if (level.native_em_level->lev->home == 0) /* all players at home */ { + local_player->LevelSolved = TRUE; + AllPlayersGone = TRUE; + + level.native_em_level->lev->home = -1; + } + + if (local_player->LevelSolved) GameWon(); - if (!TAPE_IS_STOPPED(tape)) + if (AllPlayersGone && !TAPE_IS_STOPPED(tape)) + TapeStop(); + + if (game_status != GAME_MODE_PLAYING) + return; +#else + if (level.native_em_level->lev->home == 0) /* all players at home */ + { + if (local_player->LevelSolved) + GameWon(); + + if (AllPlayersGone && !TAPE_IS_STOPPED(tape)) TapeStop(); if (game_status != GAME_MODE_PLAYING) return; } +#endif if (level.native_em_level->ply[0]->alive == 0 && level.native_em_level->ply[1]->alive == 0 &&