summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index e146625..3359a16 100644
--- a/rules.js
+++ b/rules.js
@@ -137,7 +137,9 @@ exports.roles = function (scenario) {
}
function random(n) {
- return ((game.seed = game.seed * 69621 % 0x7fffffff) / 0x7fffffff) * n | 0
+ if (game.rng === 1)
+ return ((game.seed = game.seed * 69621 % 0x7fffffff) / 0x7fffffff) * n | 0
+ return (game.seed = game.seed * 200105 % 34359738337) % n
}
function shuffle(deck) {
@@ -3137,6 +3139,10 @@ exports.setup = function (seed, scenario, options) {
}
}
+ // Old RNG for ancient replays
+ if (options.rng)
+ game.rng = options.rng
+
prepare_deck()
for (let col = 0; col < 6; ++col)