Core: replace global random state with descriptive error (#1424)

* Core: replace global random state with descriptive error

* Core: make random a proxy object and rename slot_seeds
This commit is contained in:
Fabian Dill
2023-02-02 01:14:23 +01:00
committed by GitHub
parent 4de7ebd8b0
commit 995c978628
18 changed files with 51 additions and 29 deletions

View File

@@ -2346,7 +2346,7 @@ def patch_rom(world, rom):
# Write numeric seed truncated to 32 bits for rng seeding
# Overwritten with new seed every time a new rng value is generated
rng_seed = world.multiworld.slot_seeds[world.player].getrandbits(32)
rng_seed = world.multiworld.per_slot_randoms[world.player].getrandbits(32)
rom.write_int32(rom.sym('RNG_SEED_INT'), rng_seed)
# Static initial seed value for one-time random actions like the Hylian Shield discount
rom.write_int32(rom.sym('RANDOMIZER_RNG_SEED'), rng_seed)