moved function call for getting door state to variable declaration
authorHolger Schemel <info@artsoft.org>
Sat, 2 Dec 2023 11:58:31 +0000 (12:58 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 2 Dec 2023 11:58:31 +0000 (12:58 +0100)
src/tools.c

index 8ec91e5f483674aabe50fae24d00b25278567833..e12d441b0a4d29456c01219a2a076bdbb3c51467 100644 (file)
@@ -4813,7 +4813,7 @@ static int RequestHandleEvents(unsigned int req_state, int draw_buffer_game)
 static boolean RequestDoor(char *text, unsigned int req_state)
 {
   int draw_buffer_last = GetDrawtoField();
-  unsigned int old_door_state;
+  unsigned int old_door_state = GetDoorState();
   int max_request_line_len = MAX_REQUEST_LINE_FONT1_LEN;
   int font_nr = FONT_TEXT_2;
   char *text_ptr;
@@ -4842,8 +4842,6 @@ static boolean RequestDoor(char *text, unsigned int req_state)
       req_state & REQUEST_WAIT_FOR_INPUT)
     SendToServer_PausePlaying();
 
-  old_door_state = GetDoorState();
-
   // simulate releasing mouse button over last gadget, if still pressed
   if (button_status)
     HandleGadgets(-1, -1, 0);