diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index a363346..168b03d 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -163,7 +163,7 @@ static class ExtendedPlayerControl // Check if player role name public static string GetRoleName(this PlayerControl player) { - if (!player.IsAlive() && !player.IsGhostRole() && Main.GetRoleName.TryGetValue((int)player.BetterData().DeadDisplayRole, out var roleName)) + if (!player.IsAlive() && !player.IsGhostRole() && Main.GetRoleName.TryGetValue((int)player.BetterData().RoleInfo.DeadDisplayRole, out var roleName)) { return roleName; } diff --git a/Modules/ExtendedPlayerInfo.cs b/Modules/ExtendedPlayerInfo.cs index 7b979c6..0cffe01 100644 --- a/Modules/ExtendedPlayerInfo.cs +++ b/Modules/ExtendedPlayerInfo.cs @@ -12,18 +12,17 @@ public class ExtendedPlayerInfo public bool BannedByAntiCheat { get; set; } = false; // Track Game Info - - public bool HasNoisemakerNotify { get; set; } = false; public float TimeSinceLastTask { get; set; } = 5f; public uint LastTaskId { get; set; } = 0; public int TimesCalledMeeting { get; set; } = 0; - public RoleTypes DeadDisplayRole { get; set; } public ExtendedRoleInfo? RoleInfo { get; set; } } public class ExtendedRoleInfo { public int Kills { get; set; } = 0; + public bool HasNoisemakerNotify { get; set; } = false; + public RoleTypes DeadDisplayRole { get; set; } } public static class PlayerControlExtensions diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index 2e499b5..b75306f 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -71,7 +71,7 @@ class PlayerControlPatch if (!GameStates.IsInGamePlay) { __instance.BetterData().TimesCalledMeeting = 0; - __instance.BetterData().HasNoisemakerNotify = false; + __instance.BetterData().RoleInfo.HasNoisemakerNotify = false; __instance.BetterData().TimeSinceLastTask = 5f; __instance.BetterData().LastTaskId = 999; __instance.BetterData().RoleInfo.Kills = 0; diff --git a/Patches/RoleManagerPatch.cs b/Patches/RoleManagerPatch.cs index 860a07d..3918809 100644 --- a/Patches/RoleManagerPatch.cs +++ b/Patches/RoleManagerPatch.cs @@ -254,7 +254,7 @@ public class RoleManagerPatch public static bool AssignRoleOnDeath_Prefix(/*RoleManager __instance*/ [HarmonyArgument(0)] PlayerControl player) { if (player.Data.RoleType != RoleTypes.CrewmateGhost && player.Data.RoleType != RoleTypes.ImpostorGhost) - player.BetterData().DeadDisplayRole = player.Data.RoleType; + player.BetterData().RoleInfo.DeadDisplayRole = player.Data.RoleType; if (!Main.BetterRoleAlgorithma.Value) return true; diff --git a/Patches/RolePatch.cs b/Patches/RolePatch.cs index 9991a0e..764ff7f 100644 --- a/Patches/RolePatch.cs +++ b/Patches/RolePatch.cs @@ -11,12 +11,12 @@ class RolePatch [HarmonyPrefix] public static bool NotifyOfDeath_Prefix(NoisemakerRole __instance) { - if (__instance.Player.BetterData().HasNoisemakerNotify) + if (__instance.Player.BetterData().RoleInfo.HasNoisemakerNotify) { return false; } - __instance.Player.BetterData().HasNoisemakerNotify = true; + __instance.Player.BetterData().RoleInfo.HasNoisemakerNotify = true; return true; }