Skip to content

Commit 344215a

Browse files
committed
Addressed an issue where the revived kill button wasn’t showing for revived players, and fixed an issue where revived players couldn’t move or see death task info
1 parent 4b6a7d8 commit 344215a

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

NewMod/Buttons/Necromancer/ReviveButton.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ protected override void OnClick()
100100
var local = PlayerControl.LocalPlayer;
101101
var body = GetReviveTarget();
102102

103-
if (body == null)
104-
return;
105-
106103
SoundManager.Instance.PlaySound(NewModAsset.ReviveSound?.LoadAsset(), false, 2f);
107104

108105
Utils.HandleRevive(

NewMod/Buttons/RevivedKillButton.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public override void SetOutline(bool active)
5555

5656
public override bool CanUse()
5757
{
58-
return CanUseRevivedKillButton();
58+
return base.CanUse() && CanUseRevivedKillButton();
5959
}
6060

6161
protected override void OnClick()

NewMod/Patches/Roles/RevivePatch.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public static bool Prefix(PlayerControl __instance)
1414
__instance.MyPhysics.ResetMoveState(true);
1515
__instance.clickKillCollider.enabled = true;
1616
__instance.cosmetics.SetNameMask(true);
17+
__instance.cosmetics.SetPetSource(__instance);
18+
__instance.moveable = true;
1719

1820
if (__instance.AmOwner)
1921
{
@@ -24,4 +26,13 @@ public static bool Prefix(PlayerControl __instance)
2426
return false;
2527
}
2628
}
29+
[HarmonyPatch(typeof(KillOverlay), nameof(KillOverlay.IsOpen), MethodType.Getter)]
30+
public static class KillOverlayPatch
31+
{
32+
public static void Postfix(ref bool __result)
33+
{
34+
if (__result && PlayerControl.LocalPlayer != null && !PlayerControl.LocalPlayer.Data.IsDead)
35+
__result = false;
36+
}
37+
}
2738
}

NewMod/Utilities/Utils.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ public static IEnumerator HandleRevive(PlayerControl source, byte revivedId, Rol
394394

395395
revived.Revive();
396396
revived.RemainingEmergencies = 0;
397+
RoleManager.Instance.SetRole(revived, roleToSet);
398+
revived.Data.Role.SpawnTaskHeader(revived);
397399

398400
if (AmongUsClient.Instance.AmHost)
399401
{
@@ -829,7 +831,7 @@ public static IEnumerator StartFeignDeath(PlayerControl player)
829831

830832
if (player.AmOwner)
831833
{
832-
HudManager.Instance.SetHudActive(false);
834+
HudManager.Instance.SetHudActive(player, player.Data.Role, false);
833835
}
834836
yield return new WaitForSeconds(0.5f);
835837

0 commit comments

Comments
 (0)