mirror of
https://github.com/osukey/osukey.git
synced 2025-05-21 05:27:17 +09: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 List<OsuHitObject> origHitObjects;
|
||||||
|
|
||||||
|
private Random rng;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Sudden Death (IApplicableFailOverride)
|
#region Sudden Death (IApplicableFailOverride)
|
||||||
@ -161,6 +163,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public override void ApplyToBeatmap(IBeatmap beatmap)
|
public override void ApplyToBeatmap(IBeatmap beatmap)
|
||||||
{
|
{
|
||||||
Seed.Value ??= RNG.Next();
|
Seed.Value ??= RNG.Next();
|
||||||
|
rng = new Random(Seed.Value.GetValueOrDefault());
|
||||||
|
|
||||||
var osuBeatmap = (OsuBeatmap)beatmap;
|
var osuBeatmap = (OsuBeatmap)beatmap;
|
||||||
|
|
||||||
@ -284,8 +287,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
{
|
{
|
||||||
if (hitObjects.Count == 0) return;
|
if (hitObjects.Count == 0) return;
|
||||||
|
|
||||||
var rng = new Random(Seed.Value.GetValueOrDefault());
|
|
||||||
|
|
||||||
float nextSingle(float max = 1f) => (float)(rng.NextDouble() * max);
|
float nextSingle(float max = 1f) => (float)(rng.NextDouble() * max);
|
||||||
|
|
||||||
var direction = MathHelper.TwoPi * nextSingle();
|
var direction = MathHelper.TwoPi * nextSingle();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user