Description: chdir() to the data directory before loading data
 This is necessary for starfighter to find the data files if it is not using
 a .pak file.
Author: Guus Sliepen <guus@debian.org>

--- starfighter-1.2.orig/code/Starfighter.cpp
+++ starfighter-1.2/code/Starfighter.cpp
@@ -24,6 +24,14 @@ Foundation, Inc., 59 Temple Place - Suit
 
 int main(int argc, char *argv[])
 {
+#if !USEPACK
+	char datadir[] = PACKLOCATION;
+	char *slash = strrchr(datadir, '/');
+	if(slash)
+		*slash = 0;
+	chdir(datadir);
+#endif
+
 	defineGlobals(); // Must do this first!
 
 	bool cheatAttempt = false;
