netgame: enable -loadgame (#371)

* netgame: enable -loadgame

* fix -record -loadgame
This commit is contained in:
Roman Fomin 2021-12-10 03:02:55 +07:00 committed by GitHub
parent 1dc57a508a
commit 581d645558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 10 deletions

View File

@ -133,6 +133,7 @@ int startepisode;
int startmap;
boolean autostart;
FILE *debugfile;
int startloadgame;
boolean advancedemo;
@ -2232,6 +2233,17 @@ void D_DoomMain(void)
if (*startup5) puts(startup5);
// End new startup strings
p = M_CheckParmWithArgs("-loadgame", 1);
if (p)
{
startloadgame = atoi(myargv[p+1]);
}
else
{
// Not loading a game
startloadgame = -1;
}
puts("M_Init: Init miscellaneous info.");
M_Init();
@ -2315,13 +2327,17 @@ void D_DoomMain(void)
demowarp = -1;
if (slot && ++slot < myargc)
{
char *file;
slot = atoi(myargv[slot]); // killough 3/16/98: add slot info
file = G_SaveGameName(slot); // killough 3/22/98
G_LoadGame(file, slot, true); // killough 5/15/98: add command flag
(free)(file);
}
{
startloadgame = atoi(myargv[slot]);
}
if (startloadgame >= 0)
{
char *file;
file = G_SaveGameName(startloadgame);
G_LoadGame(file, startloadgame, true); // killough 5/15/98: add command flag
(free)(file);
}
else
if (!singledemo) // killough 12/98
{

View File

@ -106,7 +106,7 @@ static void LoadGameSettings(net_gamesettings_t *settings)
startepisode = settings->episode;
startmap = settings->map;
startskill = settings->skill;
//startloadgame = settings->loadgame;
startloadgame = settings->loadgame;
lowres_turn = settings->lowres_turn;
nomonsters = settings->nomonsters;
fastparm = settings->fast_monsters;
@ -159,7 +159,7 @@ static void SaveGameSettings(net_gamesettings_t *settings)
settings->episode = startepisode;
settings->map = startmap;
settings->skill = startskill;
//settings->loadgame = startloadgame;
settings->loadgame = startloadgame;
settings->gameversion = gameversion;
settings->nomonsters = nomonsters;
settings->fast_monsters = fastparm;

View File

@ -149,6 +149,9 @@ extern skill_t startskill;
extern int startepisode;
extern int startmap;
// the -loadgame option. If this has not been provided, this is -1.
extern int startloadgame;
extern boolean autostart;
// Selected by user.

View File

@ -1711,7 +1711,6 @@ static void G_DoLoadGame(void)
// killough 2/14/98: load compatibility mode
compatibility = *save_p++;
demo_version = complevel;
gameskill = *save_p++;
gameepisode = *save_p++;