mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
fix role selection sometimes not being random
This commit is contained in:
1 parent
dcd9b43ab6
commit
b26768bbdd
1 file changed
+1
-1
@@ -827,7 +827,7 @@ internal static class CustomRoleSelector
|
||||
.GroupBy(x => x.Info.OptionType)
|
||||
.Select(x => (Grouping: x, x.FirstOrDefault().Limit))
|
||||
.SelectMany(x => x.Limit.Exists ? x.Grouping.Take(x.Limit.Value) : x.Grouping)
|
||||
.OrderByDescending(x => x.Limit is { Exists: true, Value: > 0 })
|
||||
.OrderBy(x => x.Limit is { Exists: true, Value: > 0 } ? rd.Next(100) : rd.Next(100, 1000))
|
||||
.Take(type switch
|
||||
{
|
||||
RoleAssignType.Impostor => optImpNum,
|
||||
|
||||
Reference in new issue
Block a user