mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
fix hns draft edge cases
This commit is contained in:
1 parent
44d0af0c79
commit
4112bbfaaf
2 files changed
+11
-2
No files matched your search
+10
-1
@@ -143,7 +143,16 @@ internal static class CustomHnS
|
||||
|
||||
Logger.Warn($"Number of impostors: {memberNum[Team.Impostor]}", "HnsRoleAssigner");
|
||||
|
||||
foreach (KeyValuePair<byte, CustomRoles> item in Main.SetRoles.AddRange(ChatCommands.DraftResult, false))
|
||||
Dictionary<byte, CustomRoles> preSetRoles = Main.SetRoles.AddRange(ChatCommands.DraftResult, false);
|
||||
|
||||
if (ChatCommands.DraftResult.Count > 0 && ChatCommands.DraftResult.Count + preSetRoles.Count >= allPlayers.Count && preSetRoles.All(x => x.Value is not (CustomRoles.Seeker or CustomRoles.Locator or CustomRoles.Dasher or CustomRoles.Venter or CustomRoles.Agent)))
|
||||
{
|
||||
byte removeKey = ChatCommands.DraftResult.Keys.RandomElement();
|
||||
ChatCommands.DraftResult.Remove(removeKey);
|
||||
preSetRoles.Remove(removeKey);
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<byte, CustomRoles> item in preSetRoles)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user