Expose random seed function to scripts
This commit is contained in:
1 parent
7306f7a8a5
commit
9cb623c096
1 file changed
+5
-1
+5
-1
@@ -54,11 +54,15 @@ class SandboxDate {
|
||||
|
||||
function random() {
|
||||
if (!state.rng)
|
||||
state.rng = seedrandom(state.sessionContext.timestamp);
|
||||
state.rng = seedrandom(state.sessionContext.deviceId);
|
||||
|
||||
return state.rng();
|
||||
}
|
||||
|
||||
random.seed = function(s) {
|
||||
state.rng = seedrandom(s);
|
||||
}
|
||||
|
||||
|
||||
class ParameterWrapper {
|
||||
constructor(path, attributes, unpacked, unpackedRevision) {
|
||||
|
||||
Reference in new issue
Block a user