Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Bugfix Shifter #33

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TheOtherRoles/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion TheOtherRoles/Patches/ExileControllerPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion TheOtherRoles/Patches/MeetingPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static void populateButtonsPostfix(MeetingHud __instance) {
SpriteRenderer rend = (new GameObject()).AddComponent<SpriteRenderer>();
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();
}
}
Expand Down
1 change: 1 addition & 0 deletions TheOtherRoles/Patches/PlayerControlPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down