mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
engine: userconfig.d support from old engine
This commit is contained in:
parent
544fc63b6b
commit
51a45d745e
@ -752,6 +752,27 @@ static void Host_Crash_f( void )
|
|||||||
*(volatile int *)0 = 0xffffffff;
|
*(volatile int *)0 = 0xffffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=================
|
||||||
|
Host_Userconfigd_f
|
||||||
|
=================
|
||||||
|
*/
|
||||||
|
void Host_Userconfigd_f( void )
|
||||||
|
{
|
||||||
|
search_t *t;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
t = FS_Search( "userconfig.d/*.cfg", true, false );
|
||||||
|
if( !t ) return;
|
||||||
|
|
||||||
|
for( i = 0; i < t->numfilenames; i++ )
|
||||||
|
{
|
||||||
|
Cbuf_AddText( va("exec %s\n", t->filenames[i] ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
Mem_Free( t );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
Host_InitCommon
|
Host_InitCommon
|
||||||
@ -929,6 +950,7 @@ void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bCha
|
|||||||
|
|
||||||
Cmd_AddCommand( "exec", Host_Exec_f, "execute a script file" );
|
Cmd_AddCommand( "exec", Host_Exec_f, "execute a script file" );
|
||||||
Cmd_AddCommand( "memlist", Host_MemStats_f, "prints memory pool information" );
|
Cmd_AddCommand( "memlist", Host_MemStats_f, "prints memory pool information" );
|
||||||
|
Cmd_AddCommand( "userconfigd", Host_Userconfigd_f, "execute all scripts from userconfig.d" );
|
||||||
|
|
||||||
FS_Init();
|
FS_Init();
|
||||||
Image_Init();
|
Image_Init();
|
||||||
@ -1047,6 +1069,8 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa
|
|||||||
Cbuf_AddText( "exec config.cfg\n" );
|
Cbuf_AddText( "exec config.cfg\n" );
|
||||||
Cbuf_Execute();
|
Cbuf_Execute();
|
||||||
}
|
}
|
||||||
|
// exec all files from userconfig.d
|
||||||
|
Host_Userconfigd_f();
|
||||||
break;
|
break;
|
||||||
case HOST_DEDICATED:
|
case HOST_DEDICATED:
|
||||||
// allways parse commandline in dedicated-mode
|
// allways parse commandline in dedicated-mode
|
||||||
|
Loading…
x
Reference in New Issue
Block a user