-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
When I was generating subtitles from script which contains math.random, I found that each time when I started up Aegisub, the random function always gives same results.
Then I found when I added math.randomseed(0) to script, the results are always the same as the first-time-run after startup, so it could be sure that RNG seed was set to 0 each time Aegisub starts up.
So the only one code that affects random seed could be found is in DependencyControl/Logger.moon:
unless seeded
timer.sleep 10 for i=1,50
math.randomseed(timer\timeElapsed!*1000000)
math.random, math.random, math.random
seeded = true
-- timer gets freed on garbage collection
timer = nilSo it could be preferred that timeElapsed always returns a 0 which caused the issue.
Metadata
Metadata
Assignees
Labels
No labels