mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 11:39:45 +00:00
Fix nullable roletype errors
This commit is contained in:
1 parent
11ba564eed
commit
aee304fb96
1 file changed
+14
-7
@@ -71,15 +71,22 @@ public static class LogicRoleSelectionNormalPatch
|
||||
}
|
||||
|
||||
__instance.AssignRolesFromList(players, teamMax, list, ref num);
|
||||
if (defaultRole != null)
|
||||
var defaultRole2 = team is RoleTeamTypes.Crewmate ? RoleTypes.Crewmate : RoleTypes.Impostor;
|
||||
try
|
||||
{
|
||||
while (list.Count < players.Count && list.Count + num < teamMax)
|
||||
{
|
||||
list.Add(defaultRole.Value);
|
||||
}
|
||||
|
||||
__instance.AssignRolesFromList(players, teamMax, list, ref num);
|
||||
defaultRole2 = defaultRole.Value;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignored
|
||||
}
|
||||
|
||||
while (list.Count < players.Count && list.Count + num < teamMax)
|
||||
{
|
||||
list.Add(defaultRole2);
|
||||
}
|
||||
|
||||
__instance.AssignRolesFromList(players, teamMax, list, ref num);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user