Skip to content

Commit

Permalink
Remove artificial slowness of random song picker
Browse files Browse the repository at this point in the history
Seeding the rng with the system clock in this way always provides the exact same result per second, since os.time gives a second value.
If we are going to seed it, it needs to be ms value instead or not at all.
  • Loading branch information
poco0317 committed Jun 9, 2019
1 parent d740f49 commit 151c76e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ t[#t + 1] =
end,
MouseLeftClickMessageCommand = function(self)
if group_rand ~= "" and isOver(self) then
math.randomseed(os.time())
local t = SONGMAN:GetSongsInGroup(group_rand)
local random_song = t[math.random(#t)]
SCREENMAN:GetTopScreen():GetMusicWheel():SelectSong(random_song)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ t[#t + 1] =
end,
MouseLeftClickMessageCommand = function(self)
if isOver(self) then
math.randomseed(os.time())
local t = SONGMAN:GetAllSongs()
local random_song = t[math.random(#t)]
SCREENMAN:GetTopScreen():GetMusicWheel():SelectSong(random_song)
Expand Down

0 comments on commit 151c76e

Please sign in to comment.