Before, it was possible for a network client to start a new game while
another client was still about answering a request dialog (like asking
if a tape for a solved level should be saved), causing synchronization
problems with network packet handling.
With this bugfix, handling network packets is paused during a request.
game.restart_level = FALSE;
game.restart_game_message = NULL;
+ game.request_active = FALSE;
if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
InitGameActions_MM();
/* trigger message to ask for restarting the game */
char *restart_game_message;
+ /* values for special request dialog control */
+ boolean request_active;
+
/* values for special game control */
int centered_player_nr;
int centered_player_nr_next;
{
game.restart_level = FALSE;
game.restart_game_message = NULL;
+ game.request_active = FALSE;
}
static void InitPlayerInfo(void)
void HandleNetworking(void)
{
+ /* do not handle any networking packets if request dialog is active */
+ if (game.request_active)
+ return;
+
char *error_message = HandleNetworkingPackets();
if (error_message != NULL)
int sx, sy;
int result;
+ game.request_active = TRUE;
+
setRequestPosition(&sx, &sy, FALSE);
button_status = MB_RELEASED;
BackToFront();
}
+ game.request_active = FALSE;
+
return result;
}