- moved -rngseed init to D_InitGame

This commit is contained in:
Christoph Oelckers 2022-04-29 02:25:29 +02:00
parent 72be9bcc27
commit 70c0b6a9a6

View file

@ -1931,22 +1931,6 @@ static void D_DoomInit()
gamestate = GS_STARTUP;
const char *v = Args->CheckValue("-rngseed");
if (v)
{
rngseed = staticrngseed = atoi(v);
use_staticrng = true;
if (!batchrun) Printf("D_DoomInit: Static RNGseed %d set.\n", rngseed);
}
else
{
rngseed = I_MakeRNGSeed();
use_staticrng = false;
}
srand(rngseed);
FRandom::StaticClearRandom ();
if (!batchrun) Printf ("M_LoadDefaults: Load system defaults.\n");
M_LoadDefaults (); // load before initing other systems
}
@ -2999,6 +2983,21 @@ static int D_InitGame(const FIWADInfo* iwad_info, TArray<FString> allwads)
gameinfo.nokeyboardcheats = iwad_info->nokeyboardcheats;
gameinfo.ConfigName = iwad_info->Configname;
const char *v = Args->CheckValue("-rngseed");
if (v)
{
rngseed = staticrngseed = atoi(v);
use_staticrng = true;
if (!batchrun) Printf("D_DoomInit: Static RNGseed %d set.\n", rngseed);
}
else
{
rngseed = I_MakeRNGSeed();
use_staticrng = false;
}
srand(rngseed);
FRandom::StaticClearRandom ();
FBaseCVar::DisableCallbacks();
GameConfig->DoGameSetup (gameinfo.ConfigName);