mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- Fixed: Using -playdemo in conjunction with -loadgame did not work.
SVN r3481 (trunk)
This commit is contained in:
parent
308f6cab9d
commit
cc34f973e2
3 changed files with 24 additions and 13 deletions
|
@ -63,6 +63,7 @@ typedef enum
|
|||
ga_newgame2,
|
||||
ga_loadgame,
|
||||
ga_loadgamehidecon,
|
||||
ga_loadgameplaydemo,
|
||||
ga_autoloadgame,
|
||||
ga_savegame,
|
||||
ga_autosave,
|
||||
|
|
|
@ -2329,6 +2329,15 @@ void D_DoomMain (void)
|
|||
|
||||
V_Init2();
|
||||
|
||||
v = Args->CheckValue ("-loadgame");
|
||||
if (v)
|
||||
{
|
||||
FString file(v);
|
||||
FixPathSeperator (file);
|
||||
DefaultExtension (file, ".zds");
|
||||
G_LoadGame (file);
|
||||
}
|
||||
|
||||
v = Args->CheckValue("-playdemo");
|
||||
if (v != NULL)
|
||||
{
|
||||
|
@ -2344,15 +2353,6 @@ void D_DoomMain (void)
|
|||
D_DoomLoop (); // never returns
|
||||
}
|
||||
|
||||
v = Args->CheckValue ("-loadgame");
|
||||
if (v)
|
||||
{
|
||||
FString file(v);
|
||||
FixPathSeperator (file);
|
||||
DefaultExtension (file, ".zds");
|
||||
G_LoadGame (file);
|
||||
}
|
||||
|
||||
if (gameaction != ga_loadgame && gameaction != ga_loadgamehidecon)
|
||||
{
|
||||
if (autostart || netgame)
|
||||
|
|
|
@ -1035,6 +1035,9 @@ void G_Ticker ()
|
|||
G_DoAutoSave ();
|
||||
gameaction = ga_nothing;
|
||||
break;
|
||||
case ga_loadgameplaydemo:
|
||||
G_DoLoadGame ();
|
||||
// fallthrough
|
||||
case ga_playdemo:
|
||||
G_DoPlayDemo ();
|
||||
break;
|
||||
|
@ -2366,7 +2369,7 @@ FString defdemoname;
|
|||
void G_DeferedPlayDemo (const char *name)
|
||||
{
|
||||
defdemoname = name;
|
||||
gameaction = ga_playdemo;
|
||||
gameaction = (gameaction == ga_loadgame) ? ga_loadgameplaydemo : ga_playdemo;
|
||||
}
|
||||
|
||||
CCMD (playdemo)
|
||||
|
@ -2449,7 +2452,11 @@ bool G_ProcessIFFDemo (char *mapname)
|
|||
mapname[8] = 0;
|
||||
demo_p += 8;
|
||||
rngseed = ReadLong (&demo_p);
|
||||
// Only reset the RNG if this demo is not in conjunction with a savegame.
|
||||
if (mapname[0] != 0)
|
||||
{
|
||||
FRandom::StaticClearRandom ();
|
||||
}
|
||||
consoleplayer = *demo_p++;
|
||||
break;
|
||||
|
||||
|
@ -2578,7 +2585,10 @@ void G_DoPlayDemo (void)
|
|||
// don't spend a lot of time in loadlevel
|
||||
precache = false;
|
||||
demonew = true;
|
||||
if (mapname[0] != 0)
|
||||
{
|
||||
G_InitNew (mapname, false);
|
||||
}
|
||||
C_HideConsole ();
|
||||
demonew = false;
|
||||
precache = true;
|
||||
|
@ -2599,7 +2609,7 @@ void G_TimeDemo (const char* name)
|
|||
singletics = true;
|
||||
|
||||
defdemoname = name;
|
||||
gameaction = ga_playdemo;
|
||||
gameaction = (gameaction == ga_loadgame) ? ga_loadgameplaydemo : ga_playdemo;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue