Don't change RNG in demos incase they are static

This commit is contained in:
Edward Richardson 2014-05-03 02:48:52 +12:00
parent d6af8dc352
commit 6183f8125f
2 changed files with 5 additions and 6 deletions

View File

@ -1998,6 +1998,7 @@ static void D_DoomInit()
{ {
rngseed = staticrngseed = atoi(v); rngseed = staticrngseed = atoi(v);
use_staticrng = true; use_staticrng = true;
Printf("D_DoomInit: Static RNGseed %d set.\n", rngseed);
} }
else else
rngseed = I_MakeRNGSeed(); rngseed = I_MakeRNGSeed();

View File

@ -408,13 +408,11 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
if (!savegamerestore) if (!savegamerestore)
{ {
if (use_staticrng) if (!netgame && !demorecording && !demoplayback)
{ {
rngseed = staticrngseed; // [RH] Change the random seed for each new single player game
} // [ED850] The demo already sets the RNG.
else if (!netgame) rngseed = use_staticrng ? staticrngseed : (rngseed + 1);
{ // [RH] Change the random seed for each new single player game
rngseed = rngseed + 1;
} }
FRandom::StaticClearRandom (); FRandom::StaticClearRandom ();
P_ClearACSVars(true); P_ClearACSVars(true);