- fixed progdir setup.

This commit is contained in:
Christoph Oelckers 2019-10-19 19:22:23 +02:00
parent d4fc13fba5
commit 39e32d560c
2 changed files with 3 additions and 1 deletions

View file

@ -58,7 +58,8 @@ void InitBaseRes()
engine_res.reset(FResourceFile::OpenResourceFile(baseres, true, true));
if (!engine_res)
{
wm_msgbox("Fatal error", "Engine resources (demolition.pk3) not found");
FStringf msg("Engine resources (%s) not found", baseres.GetChars());
wm_msgbox("Fatal error", msg.GetChars());
exit(-1);
}
}

View file

@ -131,6 +131,7 @@ int32_t win_buildargs(char **argvbuf)
// Figure out what directory the program resides in.
progdir = argvbuf[0];
progdir.Substitute("\\", "/");
auto lastsep = progdir.LastIndexOf('/');
if (lastsep != -1)
progdir.Truncate(lastsep + 1);