fixed bug with handling networking packets if request dialog is active
[rocksndiamonds.git] / src / tools.c
index bccbc9abbd3e6c4b82c7f16aaa5a322f33fa5d69..e9d11c13c2a1f29398e6b88a8e957781206ac372 100644 (file)
@@ -4203,7 +4203,7 @@ void WaitForEventToContinue(void)
     {
       switch (event.type)
       {
-       case EVENT_BUTTONPRESS:
+       case EVENT_BUTTONRELEASE:
        case EVENT_KEYPRESS:
 #if defined(TARGET_SDL2)
         case SDL_CONTROLLERBUTTONDOWN:
@@ -4243,6 +4243,8 @@ static int RequestHandleEvents(unsigned int req_state)
   int sx, sy;
   int result;
 
+  game.request_active = TRUE;
+
   setRequestPosition(&sx, &sy, FALSE);
 
   button_status = MB_RELEASED;
@@ -4543,6 +4545,8 @@ static int RequestHandleEvents(unsigned int req_state)
     BackToFront();
   }
 
+  game.request_active = FALSE;
+
   return result;
 }
 
@@ -4555,7 +4559,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;