DEADSOFTWARE

Cosmetic: DooM 2D:Forever -> Doom 2D: Forever
[d2df-sdl.git] / src / game / g_netmaster.pas
index 3e5a30b8aac01efc6d66acd9f8db004076ff836a..05d79edd2647194b5ed45698221741b3bdc8feef 100644 (file)
@@ -1,4 +1,4 @@
-(* Copyright (C)  DooM 2D:Forever Developers
+(* Copyright (C)  Doom 2D: Forever Developers
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -73,7 +73,7 @@ implementation
 
 uses
   SysUtils, e_msg, e_input, e_graphics, e_log, g_window, g_net, g_console,
-  g_map, g_game, g_sound, g_textures, g_gui, g_menu, g_options, g_language, wadreader;
+  g_map, g_game, g_sound, g_gui, g_menu, g_options, g_language, wadreader;
 
 var
   NetMEvent:      ENetEvent;
@@ -125,7 +125,7 @@ begin
   if not g_Net_Slist_Connect then
     Exit;
 
-  e_WriteLog('Fetching serverlist...', MSG_NOTIFY);
+  e_WriteLog('Fetching serverlist...', TMsgType.Notify);
   g_Console_Add(_lc[I_NET_MSG] + _lc[I_NET_SLIST_FETCH]);
 
   NetOut.Clear();
@@ -376,15 +376,17 @@ begin
   begin
     enet_address_set_host(@NetSlistAddr, PChar(Addr(IP[1])));
     NetSlistAddr.Port := Port;
-    e_WriteLog('Masterserver address set to ' + IP + ':' + IntToStr(Port), MSG_NOTIFY);
+    e_WriteLog('Masterserver address set to ' + IP + ':' + IntToStr(Port), TMsgType.Notify);
   end;
 end;
 
 procedure g_Serverlist_Draw(var SL: TNetServerList);
 var
   sy, i, y, mw, mx, l: Integer;
-  cw, ch: Byte;
-  ww, hh: Word;
+  cw: Byte = 0;
+  ch: Byte = 0;
+  ww: Word = 0;
+  hh: Word = 0;
   ip: string;
 begin
   ip := '';
@@ -503,13 +505,15 @@ begin
 end;
 
 procedure g_Serverlist_Control(var SL: TNetServerList);
+var
+  qm: Boolean;
 begin
   if gConsoleShow or gChatShow then
     Exit;
 
-  e_PollInput();
+  qm := g_ProcessMessages(); // this updates kbd
 
-  if e_KeyPressed(IK_ESCAPE) then
+  if qm or e_KeyPressed(IK_ESCAPE) then
   begin
     SL := nil;
     gState := STATE_MENU;