X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=b23a96dd7c0bd96a5a674617c0e15a079e04c8d4;hb=298cffce2845fea10a2f0420a26db13ea9179e57;hp=a49d312f928244787c273c0528ee7e8e25f611cc;hpb=843f357b031cd1f30167bd3d3596f372d2289b6f;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index a49d312f..b23a96dd 100644 --- a/src/tools.c +++ b/src/tools.c @@ -4236,13 +4236,19 @@ void WaitForEventToContinue(void) static int RequestHandleEvents(unsigned int req_state) { - boolean level_solved = (game_status == GAME_MODE_PLAYING && - local_player->LevelSolved_GameEnd); + boolean game_just_ended = (game_status == GAME_MODE_PLAYING && + checkGameEnded()); int width = request.width; int height = request.height; int sx, sy; int result; + /* when showing request dialog after game ended, deactivate game panel */ + if (game_just_ended) + game.panel.active = FALSE; + + game.request_active = TRUE; + setRequestPosition(&sx, &sy, FALSE); button_status = MB_RELEASED; @@ -4252,7 +4258,7 @@ static int RequestHandleEvents(unsigned int req_state) while (result < 0) { - if (level_solved) + if (game_just_ended) { /* the MM game engine does not use a special (scrollable) field buffer */ if (level.game_engine_type != GAME_ENGINE_TYPE_MM) @@ -4531,7 +4537,7 @@ static int RequestHandleEvents(unsigned int req_state) } } - if (level_solved) + if (game_just_ended) { if (global.use_envelope_request) { @@ -4543,6 +4549,8 @@ static int RequestHandleEvents(unsigned int req_state) BackToFront(); } + game.request_active = FALSE; + return result; } @@ -4555,7 +4563,7 @@ static boolean RequestDoor(char *text, unsigned int req_state) int result; int ty; - if (maxWordLengthInString(text) > MAX_REQUEST_LINE_FONT1_LEN) + if (maxWordLengthInRequestString(text) > MAX_REQUEST_LINE_FONT1_LEN) { max_request_line_len = MAX_REQUEST_LINE_FONT2_LEN; font_nr = FONT_TEXT_1;