From ff85dbc62d8da3ac25c69f3de5f94a7c38d0d34a Mon Sep 17 00:00:00 2001 From: Nova900 Date: Wed, 23 Feb 2022 06:47:05 +0100 Subject: [PATCH] Bugfix Shifter Bugfix for Shifter shifting bad role on Bait report and normal kill before meeting --- TheOtherRoles/Helpers.cs | 2 +- TheOtherRoles/Patches/ExileControllerPatch.cs | 2 +- TheOtherRoles/Patches/MeetingPatch.cs | 2 +- TheOtherRoles/Patches/PlayerControlPatch.cs | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/TheOtherRoles/Helpers.cs b/TheOtherRoles/Helpers.cs index f55bacd7b..e40690686 100644 --- a/TheOtherRoles/Helpers.cs +++ b/TheOtherRoles/Helpers.cs @@ -96,7 +96,7 @@ public static void handleVampireBiteOnBodyReport() { public static void handleShiftOnBodyReport() { // Check if Shifter has shifted bad role and option is on. If yes, kill him. - if (Shifter.shifter != null && Shifter.diesBeforeMeeting && Shifter.futureShift != null && Shifter.checkTargetIsBad(Shifter.futureShift)) { + if (Shifter.shifter != null && Shifter.diesBeforeMeeting && ! Shifter.shifter.Data.IsDead && Shifter.futureShift != null && Shifter.checkTargetIsBad(Shifter.futureShift)) { Helpers.checkMuderAttemptAndKill(Shifter.shifter, Shifter.shifter, true, false); MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShifterKilledDueBadShift, Hazel.SendOption.Reliable, -1); AmongUsClient.Instance.FinishRpcImmediately(writer); diff --git a/TheOtherRoles/Patches/ExileControllerPatch.cs b/TheOtherRoles/Patches/ExileControllerPatch.cs index f0aea6e70..9229c9715 100644 --- a/TheOtherRoles/Patches/ExileControllerPatch.cs +++ b/TheOtherRoles/Patches/ExileControllerPatch.cs @@ -32,7 +32,7 @@ public static void Prefix(ExileController __instance, [HarmonyArgument(0)]ref Ga RPCProcedure.shifterShift(Shifter.futureShift.PlayerId); } Shifter.futureShift = null; - Shifter.shiftedBadRole = false; // Shifter remove bad shift icon + Shifter.shiftedBadRole = false; // Shifter remove bad shift icon after meeting // Eraser erase if (Eraser.eraser != null && AmongUsClient.Instance.AmHost && Eraser.futureErased != null) { // We need to send the RPC from the host here, to make sure that the order of shifting and erasing is correct (for that reason the futureShifted and futureErased are being synced) diff --git a/TheOtherRoles/Patches/MeetingPatch.cs b/TheOtherRoles/Patches/MeetingPatch.cs index a85d7112c..ad03051e2 100644 --- a/TheOtherRoles/Patches/MeetingPatch.cs +++ b/TheOtherRoles/Patches/MeetingPatch.cs @@ -417,7 +417,7 @@ static void populateButtonsPostfix(MeetingHud __instance) { SpriteRenderer rend = (new GameObject()).AddComponent(); rend.transform.SetParent(pva.transform); rend.gameObject.layer = pva.Megaphone.gameObject.layer; - rend.transform.localPosition = new Vector3(-0.5f, -0.03f, -1f); + rend.transform.localPosition = new Vector3(-0.55f, -0.03f, -1f); rend.sprite = Shifter.getBadShiftOverlaySprite(); } } diff --git a/TheOtherRoles/Patches/PlayerControlPatch.cs b/TheOtherRoles/Patches/PlayerControlPatch.cs index da47ba381..8a8775288 100644 --- a/TheOtherRoles/Patches/PlayerControlPatch.cs +++ b/TheOtherRoles/Patches/PlayerControlPatch.cs @@ -625,6 +625,7 @@ static void baitUpdate() { if (deadPlayer.killerIfExisting != null && Bait.reportDelay <= 0f) { Helpers.handleVampireBiteOnBodyReport(); // Manually call Vampire handling, since the CmdReportDeadBody Prefix won't be called + Helpers.handleShiftOnBodyReport(); // Same for Shifter RPCProcedure.uncheckedCmdReportDeadBody(deadPlayer.killerIfExisting.PlayerId, Bait.bait.PlayerId); MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.UncheckedCmdReportDeadBody, Hazel.SendOption.Reliable, -1);