From 4c5eed148faa10a45636cfc0f4a824184c4800fc Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 27 Feb 2012 15:33:58 +0100 Subject: [PATCH] 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. --- code/Starfighter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/Starfighter.cpp b/code/Starfighter.cpp index c9f93c7..82001d1 100644 --- a/code/Starfighter.cpp +++ b/code/Starfighter.cpp @@ -24,6 +24,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 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;