From 0bd6bb95563fd4e8726d1516f55eb1c4013c672c Mon Sep 17 00:00:00 2001 From: Jarno Westhof Date: Wed, 1 Jan 2025 19:17:55 +0100 Subject: [PATCH] Updated to v1.32.5 Prevented YOLO seed from setting tourmant flag --- TsRandomizer/Properties/AssemblyInfo.cs | 4 ++-- .../Screens/SeedSelection/SeedSelectionMenuScreen.cs | 5 ++--- TsRandomizer/SeedOptions.cs | 11 ++++++++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/TsRandomizer/Properties/AssemblyInfo.cs b/TsRandomizer/Properties/AssemblyInfo.cs index 594d4c48..f5a87bf7 100644 --- a/TsRandomizer/Properties/AssemblyInfo.cs +++ b/TsRandomizer/Properties/AssemblyInfo.cs @@ -12,8 +12,8 @@ [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("694e46c5-fd46-4cc8-8b71-d381e154ccf7")] -[assembly: AssemblyVersion("1.32.4")] -[assembly: AssemblyFileVersion("1.32.4")] +[assembly: AssemblyVersion("1.32.5")] +[assembly: AssemblyFileVersion("1.32.5")] [assembly: InternalsVisibleTo("TsRandomizer.Tests")] [assembly: InternalsVisibleTo("TsRandomizerSeedGeneratah")] diff --git a/TsRandomizer/Screens/SeedSelection/SeedSelectionMenuScreen.cs b/TsRandomizer/Screens/SeedSelection/SeedSelectionMenuScreen.cs index 7f7fbc7c..d8fa6b1e 100644 --- a/TsRandomizer/Screens/SeedSelection/SeedSelectionMenuScreen.cs +++ b/TsRandomizer/Screens/SeedSelection/SeedSelectionMenuScreen.cs @@ -264,10 +264,9 @@ internal SeedOptionsCollection GetCurrentOptions() : new SeedOptionsCollection(seed.Options); } - internal SeedOptionsCollection GetRandomOptions() => - new SeedOptionsCollection(new SeedOptions((uint)new Random().Next())); + internal SeedOptionsCollection GetRandomOptions() => new SeedOptionsCollection(SeedOptions.CreateRandom()); - string GetHexString() + string GetHexString() { var hexString = password; diff --git a/TsRandomizer/SeedOptions.cs b/TsRandomizer/SeedOptions.cs index da63c842..4fea073a 100644 --- a/TsRandomizer/SeedOptions.cs +++ b/TsRandomizer/SeedOptions.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Globalization; namespace TsRandomizer @@ -87,6 +88,14 @@ public SeedOptions(Dictionary slotData) } } + public static SeedOptions CreateRandom() + { + var randomValue = (uint)new Random().Next(); + randomValue &= ~(1U << 13); //Tournament + + return new SeedOptions(randomValue); + } + static bool IsTrue(object o) { if (o is bool b) return b;