mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
Fix bugs
This commit is contained in:
1 parent
db37189e2a
commit
7b7076e51e
10 files changed
+41
-34
No files matched your search
@@ -55,8 +55,17 @@ namespace EHR.Modules
|
||||
{
|
||||
if (AssignedGhostRoles.Count >= GhostRoles.Count) return false;
|
||||
if (pc.IsAlive() || pc.GetCountTypes() is CountTypes.None or CountTypes.OutOfGame || pc.Is(CustomRoles.EvilSpirit)) return false;
|
||||
|
||||
var suitableRole = GetSuitableGhostRole(pc);
|
||||
if (suitableRole == CustomRoles.Specter && IsPartnerPickedRole()) return false;
|
||||
switch (suitableRole)
|
||||
{
|
||||
case CustomRoles.Specter when IsPartnerPickedRole():
|
||||
return false;
|
||||
case CustomRoles.Haunter:
|
||||
GhostRoles.Remove(CustomRoles.Haunter);
|
||||
break;
|
||||
}
|
||||
|
||||
return suitableRole.IsGhostRole() && !AssignedGhostRoles.Any(x => x.Key == pc.PlayerId || x.Value.Role == suitableRole);
|
||||
|
||||
bool IsPartnerPickedRole() => Main.PlayerStates[pc.PlayerId].Role switch
|
||||
|
||||
Reference in new issue
Block a user