Perform chdir(gameFolder) early in main()

This commit is contained in:
Jonas Kulla 2014-12-23 19:15:13 +01:00
parent 03a6c657c4
commit fcfa079e7b
2 changed files with 8 additions and 11 deletions

View file

@ -206,8 +206,15 @@ int main(int argc, char *argv[])
/* now we load the config */
Config conf;
conf.read(argc, argv);
if (!conf.gameFolder.empty())
if (chdir(conf.gameFolder.c_str()) != 0)
{
showInitError(std::string("Unable to switch into gameFolder ") + conf.gameFolder);
return 0;
}
conf.readGameINI();
assert(conf.rgssVersion >= 1 && conf.rgssVersion <= 3);