mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Make a separate function instead of clogging up IdentifyVersion
This commit is contained in:
parent
8001511b7c
commit
1844aa1445
1 changed files with 16 additions and 8 deletions
24
src/d_main.c
24
src/d_main.c
|
|
@ -880,15 +880,10 @@ static inline void D_CleanFile(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==========================================================================
|
///\brief Checks if a netgame URL is being handled, and changes working directory to the EXE's if so.
|
||||||
// Identify the SRB2 version, and IWAD file to use.
|
/// Done because browsers (at least, Firefox on Windows) launch the game from the browser's directory, which causes problems.
|
||||||
// ==========================================================================
|
static void ChangeDirForUrlHandler(void)
|
||||||
|
|
||||||
static void IdentifyVersion(void)
|
|
||||||
{
|
{
|
||||||
char *srb2wad;
|
|
||||||
const char *srb2waddir = NULL;
|
|
||||||
|
|
||||||
// URL handlers are opened by web browsers (at least Firefox) from the browser's working directory, not the game's stored directory,
|
// URL handlers are opened by web browsers (at least Firefox) from the browser's working directory, not the game's stored directory,
|
||||||
// so chdir to that directory unless overridden.
|
// so chdir to that directory unless overridden.
|
||||||
if (M_GetUrlProtocolArg() != NULL && !M_CheckParm("-nochdir"))
|
if (M_GetUrlProtocolArg() != NULL && !M_CheckParm("-nochdir"))
|
||||||
|
|
@ -917,6 +912,16 @@ static void IdentifyVersion(void)
|
||||||
I_OutputMsg("Couldn't change working directory\n");
|
I_OutputMsg("Couldn't change working directory\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
|
// Identify the SRB2 version, and IWAD file to use.
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
static void IdentifyVersion(void)
|
||||||
|
{
|
||||||
|
char *srb2wad;
|
||||||
|
const char *srb2waddir = NULL;
|
||||||
|
|
||||||
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||||
// change to the directory where 'srb2.pk3' is found
|
// change to the directory where 'srb2.pk3' is found
|
||||||
|
|
@ -1097,6 +1102,9 @@ void D_SRB2Main(void)
|
||||||
// Test Dehacked lists
|
// Test Dehacked lists
|
||||||
DEH_Check();
|
DEH_Check();
|
||||||
|
|
||||||
|
// Netgame URL special case: change working dir to EXE folder.
|
||||||
|
ChangeDirForUrlHandler();
|
||||||
|
|
||||||
// identify the main IWAD file to use
|
// identify the main IWAD file to use
|
||||||
IdentifyVersion();
|
IdentifyVersion();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue