mirror of
https://github.com/ppy/osu
synced 2024-12-14 02:46:27 +00:00
Moved RNG initialisation to a better place
This commit is contained in:
parent
6fca8ba5b0
commit
f74275a3b5
@ -93,6 +93,8 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
private List<OsuHitObject> origHitObjects;
|
||||
|
||||
private Random rng;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sudden Death (IApplicableFailOverride)
|
||||
@ -161,6 +163,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
public override void ApplyToBeatmap(IBeatmap beatmap)
|
||||
{
|
||||
Seed.Value ??= RNG.Next();
|
||||
rng = new Random(Seed.Value.GetValueOrDefault());
|
||||
|
||||
var osuBeatmap = (OsuBeatmap)beatmap;
|
||||
|
||||
@ -284,8 +287,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
if (hitObjects.Count == 0) return;
|
||||
|
||||
var rng = new Random(Seed.Value.GetValueOrDefault());
|
||||
|
||||
float nextSingle(float max = 1f) => (float)(rng.NextDouble() * max);
|
||||
|
||||
var direction = MathHelper.TwoPi * nextSingle();
|
||||
|
Loading…
Reference in New Issue
Block a user