projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed handling game actions during "play again" request in network mode
[rocksndiamonds.git]
/
src
/
tools.c
diff --git
a/src/tools.c
b/src/tools.c
index bccbc9abbd3e6c4b82c7f16aaa5a322f33fa5d69..b23a96dd7c0bd96a5a674617c0e15a079e04c8d4 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-4203,7
+4203,7
@@
void WaitForEventToContinue(void)
{
switch (event.type)
{
{
switch (event.type)
{
- case EVENT_BUTTON
PRESS
:
+ case EVENT_BUTTON
RELEASE
:
case EVENT_KEYPRESS:
#if defined(TARGET_SDL2)
case SDL_CONTROLLERBUTTONDOWN:
case EVENT_KEYPRESS:
#if defined(TARGET_SDL2)
case SDL_CONTROLLERBUTTONDOWN:
@@
-4236,13
+4236,19
@@
void WaitForEventToContinue(void)
static int RequestHandleEvents(unsigned int req_state)
{
static int RequestHandleEvents(unsigned int req_state)
{
- boolean
level_solv
ed = (game_status == GAME_MODE_PLAYING &&
-
local_player->LevelSolved_GameEnd
);
+ boolean
game_just_end
ed = (game_status == GAME_MODE_PLAYING &&
+
checkGameEnded()
);
int width = request.width;
int height = request.height;
int sx, sy;
int result;
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;
setRequestPosition(&sx, &sy, FALSE);
button_status = MB_RELEASED;
@@
-4252,7
+4258,7
@@
static int RequestHandleEvents(unsigned int req_state)
while (result < 0)
{
while (result < 0)
{
- if (
level_solv
ed)
+ if (
game_just_end
ed)
{
/* the MM game engine does not use a special (scrollable) field buffer */
if (level.game_engine_type != GAME_ENGINE_TYPE_MM)
{
/* 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_solv
ed)
+ if (
game_just_end
ed)
{
if (global.use_envelope_request)
{
{
if (global.use_envelope_request)
{
@@
-4543,6
+4549,8
@@
static int RequestHandleEvents(unsigned int req_state)
BackToFront();
}
BackToFront();
}
+ game.request_active = FALSE;
+
return result;
}
return result;
}
@@
-4555,7
+4563,7
@@
static boolean RequestDoor(char *text, unsigned int req_state)
int result;
int ty;
int result;
int ty;
- if (maxWordLengthInString(text) > MAX_REQUEST_LINE_FONT1_LEN)
+ if (maxWordLengthIn
Request
String(text) > MAX_REQUEST_LINE_FONT1_LEN)
{
max_request_line_len = MAX_REQUEST_LINE_FONT2_LEN;
font_nr = FONT_TEXT_1;
{
max_request_line_len = MAX_REQUEST_LINE_FONT2_LEN;
font_nr = FONT_TEXT_1;