From 5098e24806d14848c806fb0eee7630c75f6a2db6 Mon Sep 17 00:00:00 2001
From: Velaron <mars873@gmail.com>
Date: Wed, 7 Dec 2022 13:36:16 +0200
Subject: [PATCH] engine: client: touch: fix empty list when opening touch
 buttons menu for the first time

---
 engine/client/in_touch.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/engine/client/in_touch.c b/engine/client/in_touch.c
index 7cf93925..1dcb433b 100644
--- a/engine/client/in_touch.c
+++ b/engine/client/in_touch.c
@@ -1105,8 +1105,14 @@ static void Touch_InitConfig( void )
 	/// TODO: hud font
 	//pfnGetScreenInfo( NULL ); //HACK: update hud screen parameters like iHeight
 	if( FS_FileExists( touch_config_file->string, true ) )
+	{
 		Cbuf_AddText( va( "exec \"%s\"\n", touch_config_file->string ) );
-	else Touch_LoadDefaults_f( );
+		Cbuf_Execute();
+	}
+	else
+	{
+		Touch_LoadDefaults_f();
+	}
 
 	Touch_InitEditor();
 	touch.joytexture = ref.dllFuncs.GL_LoadTexture( touch_joy_texture->string, NULL, 0, TF_NOMIPMAP );