nooo dont set srb2waddir to NULL

This commit is contained in:
Alug committed 2025-03-27 23:50:46 +01:00
1 parent 4a2f338c85
commit 37b1ad80e3
1 file changed
+7 -11
+7 -11
View File
@@ -1243,17 +1243,15 @@ void D_CleanFile(char **filearray)
static boolean AddIWAD(void)
{
char * path = va(pandf,srb2path,"srb2.srb");
char * path = va(pandf, srb2path, "srb2.srb");
if (FIL_ReadFileOK(path))
{
D_AddFile(path, startupwadfiles);
return true;
}
else
{
return false;
}
return false;
}
// extra graphic patches for saturn specific thingies
@@ -1293,20 +1291,18 @@ static void IdentifyVersion(void)
// get the current directory (possible problem on NT with "." as current dir)
if (srb2waddir)
{
strlcpy(srb2path,srb2waddir,sizeof (srb2path));
strlcpy(srb2path, srb2waddir, sizeof(srb2path));
}
else
{
if (getcwd(srb2path, 256) != NULL)
if (getcwd(srb2path, sizeof(srb2path)))
srb2waddir = srb2path;
else
{
srb2waddir = srb2path;
}
srb2waddir = ".";
}
// Load the IWAD
if (! AddIWAD())
if (!AddIWAD())
{
I_Error("SRB2.SRB not found! Expected in %s\n", srb2waddir);
}