Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(random): handle redacted state on multiplayer clients (#885)
Fixes #870 Prior to the current plugin system, the randomness API set a default seed '0' if it didn’t receive one from game state (i.e. when it was run on a multiplayer client and the randomness state was redacted). When the new plugin system was built, this fallback value was removed, but that didn’t cause errors because the PRNG seed and state were no longer redacted. After #857 (released in v0.42.2) reintroduced redacted state for plugins, the plugin broke for multiplayer clients that no longer had access to plugin state. This commit reinstates the default seed (the result of which is discarded in any case) and adds a test for running the plugin with redacted state to catch a similar error in any future refactoring. See 4b1c135 for details of the randomness API before the current implementation.
- Loading branch information