diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-07-24 13:04:38 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 11:54:52 +0100 |
commit | 4620136eeac88c66839bdd5aca1eb37376265c34 (patch) | |
tree | af2b19f23416a8b8272caf5b0aa6c21f6e4720fd | |
parent | 10ae90c760af05516d76521f65e5d2daa71adc22 (diff) | |
download | wilderness-war-4620136eeac88c66839bdd5aca1eb37376265c34.tar.gz |
Update RNG.
-rw-r--r-- | rules.js | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |