mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-23 03:12:38 +00:00
Load add-ons in the order in which the -file and -folder arguments are specified
This commit is contained in:
parent
4af3b860fd
commit
0482eacb7c
1 changed files with 16 additions and 25 deletions
41
src/d_main.c
41
src/d_main.c
|
@ -1253,34 +1253,25 @@ void D_SRB2Main(void)
|
|||
// Do this up here so that WADs loaded through the command line can use ExecCfg
|
||||
COM_Init();
|
||||
|
||||
// add any files specified on the command line with -file wadfile
|
||||
// to the wad list
|
||||
// Add any files specified on the command line with
|
||||
// "-file <file>" or "-folder <folder>" to the add-on list
|
||||
if (!((M_GetUrlProtocolArg() || M_CheckParm("-connect")) && !M_CheckParm("-server")))
|
||||
{
|
||||
if (M_CheckParm("-file"))
|
||||
INT32 addontype = 0;
|
||||
INT32 i;
|
||||
|
||||
for (i = 1; i < myargc; i++)
|
||||
{
|
||||
// the parms after p are wadfile names,
|
||||
// until end of parms or another - preceded parm
|
||||
while (M_IsNextParm())
|
||||
{
|
||||
const char *s = M_GetNextParm();
|
||||
|
||||
if (s) // Check for NULL?
|
||||
D_AddFile(startuppwads, s);
|
||||
}
|
||||
}
|
||||
|
||||
if (M_CheckParm("-folder"))
|
||||
{
|
||||
// the parms after p are folder names,
|
||||
// until end of parms or another - preceded parm
|
||||
while (M_IsNextParm())
|
||||
{
|
||||
const char *s = M_GetNextParm();
|
||||
|
||||
if (s) // Check for NULL?
|
||||
D_AddFolder(startuppwads, s);
|
||||
}
|
||||
if (!strcasecmp(myargv[i], "-file"))
|
||||
addontype = 1;
|
||||
else if (!strcasecmp(myargv[i], "-folder"))
|
||||
addontype = 2;
|
||||
else if (myargv[i][0] == '-' || myargv[i][0] == '+')
|
||||
addontype = 0;
|
||||
else if (addontype == 1)
|
||||
D_AddFile(startuppwads, myargv[i]);
|
||||
else if (addontype == 2)
|
||||
D_AddFolder(startuppwads, myargv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue