From 60aaa92e4fb9ee70c975d59e68495326e9316864 Mon Sep 17 00:00:00 2001 From: "Imp11(dabao40)" Date: Tue, 1 Oct 2024 14:23:08 +0800 Subject: [PATCH] Busker bug fixes --- TheOtherRoles/Patches/UsablesPatch.cs | 7 ++++--- TheOtherRoles/RPC.cs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/TheOtherRoles/Patches/UsablesPatch.cs b/TheOtherRoles/Patches/UsablesPatch.cs index 365ed82..3793ac0 100644 --- a/TheOtherRoles/Patches/UsablesPatch.cs +++ b/TheOtherRoles/Patches/UsablesPatch.cs @@ -376,10 +376,11 @@ static void Postfix(VitalsMinigame __instance) { int index = 0; int displayType = Helpers.GetDisplayType(__instance.vitals.Count); foreach (VitalsPanel vital in (Il2CppArrayBase)__instance.vitals) - { + { + var color = vital.PlayerInfo.IsDead && !Busker.buskerList.Any(x => x == vital.PlayerInfo.PlayerId) ? Palette.HalfWhite : Palette.White; vital.PlayerIcon.cosmetics.SetSkin(vital.PlayerInfo.DefaultOutfit.SkinId, vital.PlayerInfo.DefaultOutfit.ColorId, (Action)null); - vital.PlayerIcon.cosmetics.SetHatColor(Palette.White); - vital.PlayerIcon.cosmetics.SetVisorAlpha(Palette.White.a); + vital.PlayerIcon.cosmetics.SetHatColor(color); + vital.PlayerIcon.cosmetics.SetVisorAlpha(color.a); vital.transform.localPosition = ToVoteAreaPos(__instance, index, displayType); Transform transform = vital.transform; transform.localScale *= PanelAreaScale[displayType]; diff --git a/TheOtherRoles/RPC.cs b/TheOtherRoles/RPC.cs index 503bf7e..48e0cdd 100644 --- a/TheOtherRoles/RPC.cs +++ b/TheOtherRoles/RPC.cs @@ -1999,7 +1999,7 @@ public static void buskerPseudocide(byte targetId, bool isTrueDead, bool isLover else if (Akujo.akujo != null && Busker.busker == Akujo.honmei) otherLover = Akujo.akujo; - if (!otherLover.Data.IsDead) + if (otherLover != null && !otherLover.Data.IsDead) { otherLover.MurderPlayer(otherLover, MurderResultFlags.Succeeded); GameHistory.overrideDeathReasonAndKiller(otherLover, DeadPlayer.CustomDeathReason.LoverSuicide);