Skip to content

Commit

Permalink
use rng.NextDouble instead of NextSingle
Browse files Browse the repository at this point in the history
This is to avoid using functions that are trimmed during lazer's AOT compilation for mobile platforms. This ensures that sentakki DLL would work using the regular installation method.
  • Loading branch information
LumpBloom7 committed Dec 7, 2024
1 parent 4bcebcc commit d6da08b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void NewPattern()

while (true)
{
if (rng.NextSingle() > prob)
if (rng.NextDouble() > prob)
break;

cycleLanes.Add(rng.Next(0, 8));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static T ProbabilityPick<T>(this IEnumerable<T> enumerable, Func<T, doubl
foreach (var item in list)
pSum += max - probabilitySourceSelector(item);

double ran = rng.NextSingle() * pSum;
double ran = rng.NextDouble() * pSum;

double cumulative = 0;

Expand Down

0 comments on commit d6da08b

Please sign in to comment.