E NEARDATA boolean defer_see_monsters;
E NEARDATA boolean in_steed_dismounting;
+E NEARDATA boolean has_strong_rngseed;
E const int shield_static[];
/* weapon picked is merged with wielded one */
NEARDATA boolean in_steed_dismounting = FALSE;
+NEARDATA boolean has_strong_rngseed = FALSE;
NEARDATA coord bhitpos = DUMMY;
NEARDATA coord doors[DOORMAX] = { DUMMY };
void
reseed_random()
{
- /* reseed */
- init_random();
+ /* only reseed if we are certain that the seed generation is unguessable
+ * by the players. */
+ if (has_strong_rngseed)
+ init_random();
}
time_t
fptr = fopen(DEV_RANDOM, "r");
if (fptr) {
fread(&seed, sizeof(long), 1, fptr);
+ has_strong_rngseed = TRUE;
}
fclose(fptr);
#else
(ULONG) sizeof ourseed, 0);
if (status == STATUS_SUCCESS) {
BCryptCloseAlgorithmProvider(hRa,0);
+ has_strong_rngseed = TRUE;
Plan_B = FALSE;
}
}