Skip to content

Commit

Permalink
Fix game options menu
Browse files Browse the repository at this point in the history
  • Loading branch information
NikoCat233 committed May 5, 2024
1 parent fefec2a commit 6828ccb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/CrowdedMod/Patches/GenericPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,13 @@ public static class GameOptionsMenu_Start
{
public static void Postfix(ref GameOptionsMenu __instance)
{
__instance.GetComponentsInChildren<NumberOption>()
.First(o => o.Title == StringNames.GameNumImpostors)
// ReSharper disable once PossibleLossOfFraction
.ValidRange = new FloatRange(1, CrowdedModPlugin.MaxImpostors);
var numberOptions = __instance.GetComponentsInChildren<NumberOption>();

if (numberOptions.Any(o => o.Title == StringNames.GameNumImpostors))
{
numberOptions.First(o => o.Title == StringNames.GameNumImpostors)
.ValidRange = new FloatRange(1, CrowdedModPlugin.MaxImpostors);
}
}
}
}

0 comments on commit 6828ccb

Please sign in to comment.