From 643538ab5a6a098de6f2b0d8c2ef8004996d8fb0 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Thu, 28 Dec 2023 22:10:40 -0500 Subject: [PATCH] Use deterministic RNG seed for Time Attack Based off of the hash from the map's lump name. --- src/g_game.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 316280198..7e99e70c8 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5882,7 +5882,18 @@ void G_InitNew(UINT8 pencoremode, INT32 map, boolean resetplayer, boolean skippr comebackshowninfo = false; if (!demo.playback && !netgame) // Netgame sets random seed elsewhere, demo playback sets seed just before us! - P_ClearRandom(M_RandomizedSeed()); // Use a more "Random" random seed + { + if (modeattacking != ATTACKING_NONE && mapheaderinfo[map-1]->lumpnum != LUMPERROR) + { + // Use deterministic starting RNG for Time Attack + P_ClearRandom(mapheaderinfo[map-1]->lumpnamehash); + } + else + { + // Use a more "Random" random seed + P_ClearRandom(M_RandomizedSeed()); + } + } // Clear a bunch of variables redscore = bluescore = lastmap = 0;