From 0f52924bd95347684a7635a9843802364b6d9712 Mon Sep 17 00:00:00 2001
From: DeaDDooMER <deaddoomer@deadsoftware.ru>
Date: Mon, 7 Oct 2019 19:13:44 +0300
Subject: [PATCH] read dfconfig.cfg before init

---
 src/game/g_console.pas | 11 +++++++----
 src/game/g_main.pas    |  6 ++++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index 7caa3ba..4141f27 100644
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
@@ -37,6 +37,7 @@ uses
     LAST_ACTION = ACTION_WEAPPREV;
 
 procedure g_Console_Init;
+procedure g_Console_SysInit;
 procedure g_Console_Update;
 procedure g_Console_Draw (MessagesOnly: Boolean = False);
 procedure g_Console_Char (C: AnsiChar);
@@ -831,11 +832,9 @@ begin
   end
 end;
 
-procedure g_Console_Init();
-  var
-    a: Integer;
+procedure g_Console_SysInit;
+  var a: Integer;
 begin
-  g_Texture_CreateWAD(ID, GameWAD+':TEXTURES\CONSOLE');
   Cons_Y := -Floor(gScreenHeight * ConsoleHeight);
   gConsoleShow := False;
   gChatShow := False;
@@ -1019,7 +1018,11 @@ begin
   g_Console_ReadConfig(GameDir + '/dfconfig.cfg');
   g_Console_ReadConfig(GameDir + '/autoexec.cfg');
   gParsingBinds := False;
+end;
 
+procedure g_Console_Init;
+begin
+  g_Texture_CreateWAD(ID, GameWAD+':TEXTURES\CONSOLE');
   g_Console_Add(Format(_lc[I_CONSOLE_WELCOME], [GAME_VERSION]));
   g_Console_Add('');
 end;
diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index d60f2dd..92c0ff5 100644
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
@@ -111,8 +111,12 @@ begin
     raise Exception.Create('SDL: Init failed: ' + SDL_GetError());
 {$ENDIF}
 
+  e_WriteLog('Init Input', TMsgType.Notify);
+  e_InitInput;
+
   e_WriteLog('Read config file', TMsgType.Notify);
   g_Options_Read(GameDir + '/' + CONFIG_FILENAME);
+  g_Console_SysInit;
 
   //GetSystemDefaultLCID()
 
@@ -202,8 +206,6 @@ begin
   NoSound := False;
 {$ENDIF}
 
-  e_WriteLog('Init Input', TMsgType.Notify);
-  e_InitInput();
   g_Touch_Init;
 
 (*
-- 
2.29.2