mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-26 14:33:46 -04:00
netgame: enable -loadgame (#371)
* netgame: enable -loadgame * fix -record -loadgame
This commit is contained in:
parent
1dc57a508a
commit
581d645558
@ -133,6 +133,7 @@ int startepisode;
|
|||||||
int startmap;
|
int startmap;
|
||||||
boolean autostart;
|
boolean autostart;
|
||||||
FILE *debugfile;
|
FILE *debugfile;
|
||||||
|
int startloadgame;
|
||||||
|
|
||||||
boolean advancedemo;
|
boolean advancedemo;
|
||||||
|
|
||||||
@ -2232,6 +2233,17 @@ void D_DoomMain(void)
|
|||||||
if (*startup5) puts(startup5);
|
if (*startup5) puts(startup5);
|
||||||
// End new startup strings
|
// 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.");
|
puts("M_Init: Init miscellaneous info.");
|
||||||
M_Init();
|
M_Init();
|
||||||
|
|
||||||
@ -2315,13 +2327,17 @@ void D_DoomMain(void)
|
|||||||
demowarp = -1;
|
demowarp = -1;
|
||||||
|
|
||||||
if (slot && ++slot < myargc)
|
if (slot && ++slot < myargc)
|
||||||
{
|
{
|
||||||
char *file;
|
startloadgame = atoi(myargv[slot]);
|
||||||
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
|
if (startloadgame >= 0)
|
||||||
(free)(file);
|
{
|
||||||
}
|
char *file;
|
||||||
|
file = G_SaveGameName(startloadgame);
|
||||||
|
G_LoadGame(file, startloadgame, true); // killough 5/15/98: add command flag
|
||||||
|
(free)(file);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (!singledemo) // killough 12/98
|
if (!singledemo) // killough 12/98
|
||||||
{
|
{
|
||||||
|
@ -106,7 +106,7 @@ static void LoadGameSettings(net_gamesettings_t *settings)
|
|||||||
startepisode = settings->episode;
|
startepisode = settings->episode;
|
||||||
startmap = settings->map;
|
startmap = settings->map;
|
||||||
startskill = settings->skill;
|
startskill = settings->skill;
|
||||||
//startloadgame = settings->loadgame;
|
startloadgame = settings->loadgame;
|
||||||
lowres_turn = settings->lowres_turn;
|
lowres_turn = settings->lowres_turn;
|
||||||
nomonsters = settings->nomonsters;
|
nomonsters = settings->nomonsters;
|
||||||
fastparm = settings->fast_monsters;
|
fastparm = settings->fast_monsters;
|
||||||
@ -159,7 +159,7 @@ static void SaveGameSettings(net_gamesettings_t *settings)
|
|||||||
settings->episode = startepisode;
|
settings->episode = startepisode;
|
||||||
settings->map = startmap;
|
settings->map = startmap;
|
||||||
settings->skill = startskill;
|
settings->skill = startskill;
|
||||||
//settings->loadgame = startloadgame;
|
settings->loadgame = startloadgame;
|
||||||
settings->gameversion = gameversion;
|
settings->gameversion = gameversion;
|
||||||
settings->nomonsters = nomonsters;
|
settings->nomonsters = nomonsters;
|
||||||
settings->fast_monsters = fastparm;
|
settings->fast_monsters = fastparm;
|
||||||
|
@ -149,6 +149,9 @@ extern skill_t startskill;
|
|||||||
extern int startepisode;
|
extern int startepisode;
|
||||||
extern int startmap;
|
extern int startmap;
|
||||||
|
|
||||||
|
// the -loadgame option. If this has not been provided, this is -1.
|
||||||
|
extern int startloadgame;
|
||||||
|
|
||||||
extern boolean autostart;
|
extern boolean autostart;
|
||||||
|
|
||||||
// Selected by user.
|
// Selected by user.
|
||||||
|
@ -1711,7 +1711,6 @@ static void G_DoLoadGame(void)
|
|||||||
|
|
||||||
// killough 2/14/98: load compatibility mode
|
// killough 2/14/98: load compatibility mode
|
||||||
compatibility = *save_p++;
|
compatibility = *save_p++;
|
||||||
demo_version = complevel;
|
|
||||||
|
|
||||||
gameskill = *save_p++;
|
gameskill = *save_p++;
|
||||||
gameepisode = *save_p++;
|
gameepisode = *save_p++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user