shithub: hexen

Download patch

ref: 7080327c17337b6557bdfaa966ff88c02ea65acb
parent: b3441290a449c995931466ac99653fd0e1768ced
author: Jacob Moody <[email protected]>
date: Tue Jan 24 00:54:08 EST 2023

savegames should also go to basePath

--- a/h2_main.c
+++ b/h2_main.c
@@ -220,16 +220,17 @@
 	W_InitMultipleFiles(wadloc);
 	W_CheckWADFiles();
 
-	strncpy(basedefault, wadloc[0], sizeof(basedefault)-5);
-	basedefault[sizeof(basedefault)-5] = '\0';
+	strcpy(basedefault, wadloc[0]);
 	slash = strrchr(basedefault, '/');
-	if (slash++ == 0)
-		slash = basedefault;
-	strcpy(slash, "cfg");
+	if (!slash)
+		basedefault[0] = '\0';
+	else
+		slash[1] = '\0';
+	basePath = basedefault;
 
 	// Load defaults before initing other systems
 	ST_Message("M_LoadDefaults: Load system defaults.\n");
-	M_LoadDefaults(basedefault);
+	M_LoadDefaults("cfg");
 
 	ST_Message("Z_Init: Init zone memory allocation daemon.\n");
 	Z_Init();