mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-25 05:11:29 +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_newgame2,
|
||||||
ga_loadgame,
|
ga_loadgame,
|
||||||
ga_loadgamehidecon,
|
ga_loadgamehidecon,
|
||||||
|
ga_loadgameplaydemo,
|
||||||
ga_autoloadgame,
|
ga_autoloadgame,
|
||||||
ga_savegame,
|
ga_savegame,
|
||||||
ga_autosave,
|
ga_autosave,
|
||||||
|
|
|
@ -2329,6 +2329,15 @@ void D_DoomMain (void)
|
||||||
|
|
||||||
V_Init2();
|
V_Init2();
|
||||||
|
|
||||||
|
v = Args->CheckValue ("-loadgame");
|
||||||
|
if (v)
|
||||||
|
{
|
||||||
|
FString file(v);
|
||||||
|
FixPathSeperator (file);
|
||||||
|
DefaultExtension (file, ".zds");
|
||||||
|
G_LoadGame (file);
|
||||||
|
}
|
||||||
|
|
||||||
v = Args->CheckValue("-playdemo");
|
v = Args->CheckValue("-playdemo");
|
||||||
if (v != NULL)
|
if (v != NULL)
|
||||||
{
|
{
|
||||||
|
@ -2344,15 +2353,6 @@ void D_DoomMain (void)
|
||||||
D_DoomLoop (); // never returns
|
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 (gameaction != ga_loadgame && gameaction != ga_loadgamehidecon)
|
||||||
{
|
{
|
||||||
if (autostart || netgame)
|
if (autostart || netgame)
|
||||||
|
|
|
@ -1035,6 +1035,9 @@ void G_Ticker ()
|
||||||
G_DoAutoSave ();
|
G_DoAutoSave ();
|
||||||
gameaction = ga_nothing;
|
gameaction = ga_nothing;
|
||||||
break;
|
break;
|
||||||
|
case ga_loadgameplaydemo:
|
||||||
|
G_DoLoadGame ();
|
||||||
|
// fallthrough
|
||||||
case ga_playdemo:
|
case ga_playdemo:
|
||||||
G_DoPlayDemo ();
|
G_DoPlayDemo ();
|
||||||
break;
|
break;
|
||||||
|
@ -2366,7 +2369,7 @@ FString defdemoname;
|
||||||
void G_DeferedPlayDemo (const char *name)
|
void G_DeferedPlayDemo (const char *name)
|
||||||
{
|
{
|
||||||
defdemoname = name;
|
defdemoname = name;
|
||||||
gameaction = ga_playdemo;
|
gameaction = (gameaction == ga_loadgame) ? ga_loadgameplaydemo : ga_playdemo;
|
||||||
}
|
}
|
||||||
|
|
||||||
CCMD (playdemo)
|
CCMD (playdemo)
|
||||||
|
@ -2449,7 +2452,11 @@ bool G_ProcessIFFDemo (char *mapname)
|
||||||
mapname[8] = 0;
|
mapname[8] = 0;
|
||||||
demo_p += 8;
|
demo_p += 8;
|
||||||
rngseed = ReadLong (&demo_p);
|
rngseed = ReadLong (&demo_p);
|
||||||
|
// Only reset the RNG if this demo is not in conjunction with a savegame.
|
||||||
|
if (mapname[0] != 0)
|
||||||
|
{
|
||||||
FRandom::StaticClearRandom ();
|
FRandom::StaticClearRandom ();
|
||||||
|
}
|
||||||
consoleplayer = *demo_p++;
|
consoleplayer = *demo_p++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2578,7 +2585,10 @@ void G_DoPlayDemo (void)
|
||||||
// don't spend a lot of time in loadlevel
|
// don't spend a lot of time in loadlevel
|
||||||
precache = false;
|
precache = false;
|
||||||
demonew = true;
|
demonew = true;
|
||||||
|
if (mapname[0] != 0)
|
||||||
|
{
|
||||||
G_InitNew (mapname, false);
|
G_InitNew (mapname, false);
|
||||||
|
}
|
||||||
C_HideConsole ();
|
C_HideConsole ();
|
||||||
demonew = false;
|
demonew = false;
|
||||||
precache = true;
|
precache = true;
|
||||||
|
@ -2599,7 +2609,7 @@ void G_TimeDemo (const char* name)
|
||||||
singletics = true;
|
singletics = true;
|
||||||
|
|
||||||
defdemoname = name;
|
defdemoname = name;
|
||||||
gameaction = ga_playdemo;
|
gameaction = (gameaction == ga_loadgame) ? ga_loadgameplaydemo : ga_playdemo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue