From 4620136eeac88c66839bdd5aca1eb37376265c34 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 24 Jul 2022 13:04:38 +0200 Subject: Update RNG. --- rules.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 61ccff5..5ac89f0 100644 --- a/rules.js +++ b/rules.js @@ -233,7 +233,9 @@ function abs(x) { function random(n) { clear_undo() - 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 roll_die(reason) { @@ -9369,6 +9371,10 @@ exports.setup = function (seed, scenario, options) { log: [], }) + // Old RNG for ancient replays + if (options.rng) + game.rng = options.rng + switch (scenario) { default: // fallthrough -- cgit v1.2.3