[Scummvm-git-logs] scummvm master -> 0c19a66330371c9570977917623fecb52d7deb1c
sev-
noreply at scummvm.org
Tue Jun 9 11:29:44 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
0c19a66330 DIRECTOR: Allow overriding random seed via GUI option
Commit: 0c19a66330371c9570977917623fecb52d7deb1c
https://github.com/scummvm/scummvm/commit/0c19a66330371c9570977917623fecb52d7deb1c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-06-09T13:29:22+02:00
Commit Message:
DIRECTOR: Allow overriding random seed via GUI option
Please denote that the original always had seed inited with 1,
e.g. not a conventional timestamp or anything. The Director Player,
thus, was generating the same random number sequence on restart
Changed paths:
engines/director/util.cpp
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 43903f030d0..0d42c361f1f 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -1206,6 +1206,12 @@ Common::Path dumpFactoryName(const char *prefix, const char *name, const char *e
void RandomState::setSeed(int seed) {
init(32);
+ // If we a GUI override, use that instead of the provided seed
+ if (ConfMan.hasKey("random_seed")) {
+ debugC(1, kDebugLingoExec, "Random seed is requested to be set to %d, but overridden by config to %d", seed, ConfMan.getInt("random_seed"));
+ seed = ConfMan.getInt("random_seed");
+ }
+
_seed = seed ? seed : 1;
}
@@ -1238,7 +1244,9 @@ void RandomState::init(int len) {
_len = (1 << len) - 1;
}
- _seed = 1;
+ // The original is _always_ initalized with a seed of 1. It is hardcoded and is by design
+ // The developers were offered to use `set the randomSeed` Lingo
+ setSeed(1);
_mask = masks[len - 2];
}
More information about the Scummvm-git-logs
mailing list