From f8bb63483fbacf6ed836cc013e849d3d0d2e7854 Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Sun, 1 Sep 2024 20:54:35 -0400 Subject: [PATCH] fixing possible issues with ghost roles --- MiraAPI/Roles/CustomRoleManager.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MiraAPI/Roles/CustomRoleManager.cs b/MiraAPI/Roles/CustomRoleManager.cs index ca34213..a3d36ec 100644 --- a/MiraAPI/Roles/CustomRoleManager.cs +++ b/MiraAPI/Roles/CustomRoleManager.cs @@ -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 roles, MiraPluginInfo pluginInfo) @@ -81,8 +86,8 @@ internal static void RegisterRoleTypes(List 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;