mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
Don't let the game start if the saved game passed to -loadgame is invalid. Often times, especially during a multiplayer game, a player can accidentally pass an invalid save file to load at the command line, which results in the netgame starting anyway before immediately desyncing. This aims to address that.
This commit is contained in:
parent
61d49a2007
commit
4d353318d9
1 changed files with 13 additions and 0 deletions
|
@ -3158,6 +3158,19 @@ static int D_DoomMain_Internal (void)
|
|||
// Now that we have the IWADINFO, initialize the autoload ini sections.
|
||||
GameConfig->DoAutoloadSetup(iwad_man);
|
||||
|
||||
// Prevent the game from starting if the savegame passed to -loadgame is invalid
|
||||
v = Args->CheckValue("-loadgame");
|
||||
if (v)
|
||||
{
|
||||
FString file(v);
|
||||
FixPathSeperator(file);
|
||||
DefaultExtension(file, "." SAVEGAME_EXT);
|
||||
if (!FileExists(file))
|
||||
{
|
||||
I_FatalError("Cannot find savegame %s", file.GetChars());
|
||||
}
|
||||
}
|
||||
|
||||
// reinit from here
|
||||
|
||||
do
|
||||
|
|
Loading…
Reference in a new issue