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.
This commit is contained in:
Guus Sliepen 2012-02-27 15:33:58 +01:00
parent 78459e9fdb
commit 4c5eed148f
1 changed files with 8 additions and 0 deletions

View File

@ -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;