shithub: qk2

Download patch

ref: 8ec7f169c5bb4ff30cacaaccbc99585e95d0d008
parent: a2aeb3831f5177a1a6d6150e00c81baf331bfb4e
author: Konstantinn Bonnet <qu7uux@gmail.com>
date: Fri Mar 13 22:50:58 EDT 2015

install in $home/bin/$objtype, data in $home/lib/quake2

--- a/mkfile
+++ b/mkfile
@@ -1,7 +1,7 @@
 </$objtype/mkfile
 
-BIN=.
-TARG=qk2
+BIN=$home/bin/$objtype
+TARG=quake2
 
 CLOFILES=\
 	client/cl_cin.$O\
--- a/qcommon/files.c
+++ b/qcommon/files.c
@@ -834,6 +834,9 @@
 */
 void FS_InitFilesystem (void)
 {
+	static char homedir[1024];
+	char *home;
+
 	Cmd_AddCommand ("path", FS_Path_f);
 	Cmd_AddCommand ("link", FS_Link_f);
 	Cmd_AddCommand ("dir", FS_Dir_f );
@@ -842,7 +845,12 @@
 	// basedir <path>
 	// allows the game to run from outside the data tree
 	//
-	fs_basedir = Cvar_Get ("basedir", ".", CVAR_NOSET);
+	if(home = getenv("home")){
+		snprint(homedir, sizeof homedir, "%s/lib/quake2", home);
+		free(home);
+	}else
+		snprint(homedir, sizeof homedir, "/sys/lib/quake2");
+	fs_basedir = Cvar_Get ("basedir", homedir, CVAR_NOSET);
 
 	//
 	// cddir <path>