Skip to content

Commit

Permalink
fixing possible issues with ghost roles
Browse files Browse the repository at this point in the history
  • Loading branch information
XtraCube committed Sep 2, 2024
1 parent a3dd4ac commit f8bb634
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions MiraAPI/Roles/CustomRoleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ private static ushort GetNextRoleId()
internal static void RegisterInRoleManager()
{
RoleManager.Instance.AllRoles = RoleManager.Instance.AllRoles.Concat(CustomRoles.Values).ToArray();

foreach (var role in CustomRoles.Values.Where(x=>x.IsDead))
{
RoleManager.GhostRoles.Add(role.Role);
}
}

internal static void RegisterRoleTypes(List<Type> roles, MiraPluginInfo pluginInfo)
Expand Down Expand Up @@ -81,8 +86,8 @@ internal static void RegisterRoleTypes(List<Type> roles, MiraPluginInfo pluginIn
roleBehaviour.BlurbNameLong = CustomStringName.CreateAndRegister(customRole.RoleLongDescription);
roleBehaviour.AffectedByLightAffectors = customRole.AffectedByLight;
roleBehaviour.CanBeKilled = customRole.CanGetKilled;
roleBehaviour.CanUseKillButton = customRole.CanKill;
roleBehaviour.TasksCountTowardProgress = customRole.TasksCount;
roleBehaviour.CanUseKillButton = customRole.CanUseKill;
roleBehaviour.TasksCountTowardProgress = customRole.TasksCountForProgress;
roleBehaviour.CanVent = customRole.CanUseVent;
roleBehaviour.DefaultGhostRole = customRole.GhostRole;
roleBehaviour.MaxCount = customRole.MaxPlayers;
Expand Down

0 comments on commit f8bb634

Please sign in to comment.