shithub: qk2

Download patch

ref: db0bb9fc57c0cf907a9d90e19d5bd7c4149e4ea8
parent: 4c0d81ebc043de0e16fc9331c1246b16bcbc2c02
author: qwx <qwx@sciops.net>
date: Sat Aug 15 06:29:13 EDT 2020

files: correctly set user directory if game isn't baseq2

--- a/files.c
+++ b/files.c
@@ -531,6 +531,7 @@
 void FS_SetGamedir (char *dir)
 {
 	searchpath_t	*next;
+	char *home;
 
 	if (strstr(dir, "..") || strstr(dir, "/")
 		|| strstr(dir, "\\") || strstr(dir, ":") )
@@ -570,6 +571,10 @@
 		if (fs_cddir->string[0])
 			FS_AddGameDirectory (va("%s/%s", fs_cddir->string, dir) );
 		FS_AddGameDirectory (va("%s/%s", fs_basedir->string, dir) );
+		if((home = getenv("home")) != nil){
+			FS_AddGameDirectory(va("%s/lib/quake2/%s", home, dir));
+			free(home);
+		}
 	}
 }