mirror of
https://github.com/dhewm/dhewm3.git
synced 2024-11-27 06:32:27 +00:00
Fall back to demo/ if no gamedata can be found in base/
The demo game data is in demo/ instead of base/, so try to fall back to that to cause minimal confusion.
This commit is contained in:
parent
42886f0e4b
commit
efd814a4e0
1 changed files with 16 additions and 5 deletions
|
@ -2676,14 +2676,22 @@ void idFileSystemLocal::Init( void ) {
|
||||||
// spawn a thread to handle background file reads
|
// spawn a thread to handle background file reads
|
||||||
StartBackgroundDownloadThread();
|
StartBackgroundDownloadThread();
|
||||||
|
|
||||||
|
if ( ReadFile( "default.cfg", NULL, NULL ) <= 0 ) {
|
||||||
|
// DG: the demo gamedata is in demo/ instead of base/. to make it "just work", add a fallback for that
|
||||||
|
if(fs_game.GetString()[0] == '\0' || idStr::Icmp(fs_game.GetString(), BASE_GAMEDIR) == 0) {
|
||||||
|
common->Warning("Couldn't find default.cfg in %s/, trying again with demo/\n", BASE_GAMEDIR);
|
||||||
|
fs_game.SetString("demo");
|
||||||
|
fs_game_base.SetString("demo");
|
||||||
|
Restart();
|
||||||
|
} else {
|
||||||
// if we can't find default.cfg, assume that the paths are
|
// if we can't find default.cfg, assume that the paths are
|
||||||
// busted and error out now, rather than getting an unreadable
|
// busted and error out now, rather than getting an unreadable
|
||||||
// graphics screen when the font fails to load
|
// graphics screen when the font fails to load
|
||||||
// Dedicated servers can run with no outside files at all
|
// Dedicated servers can run with no outside files at all
|
||||||
if ( ReadFile( "default.cfg", NULL, NULL ) <= 0 ) {
|
|
||||||
common->FatalError( "Couldn't load default.cfg" );
|
common->FatalError( "Couldn't load default.cfg" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
|
@ -2696,6 +2704,9 @@ void idFileSystemLocal::Restart( void ) {
|
||||||
|
|
||||||
Startup( );
|
Startup( );
|
||||||
|
|
||||||
|
// spawn a thread to handle background file reads
|
||||||
|
StartBackgroundDownloadThread();
|
||||||
|
|
||||||
// if we can't find default.cfg, assume that the paths are
|
// if we can't find default.cfg, assume that the paths are
|
||||||
// busted and error out now, rather than getting an unreadable
|
// busted and error out now, rather than getting an unreadable
|
||||||
// graphics screen when the font fails to load
|
// graphics screen when the font fails to load
|
||||||
|
|
Loading…
Reference in a new issue