Skip to content

Commit

Permalink
Merge pull request #1387 from EnhancedNetwork/FixModdedClientsNotRese…
Browse files Browse the repository at this point in the history
…tKillCooldownAfterMeeting

Fix Modded Clients Always Play Shield Animation When "Disable Shield Animations" Is off
  • Loading branch information
NikoCat233 authored Jan 23, 2025
2 parents 90e885a + 28352a7 commit 89cee97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Modules/AntiBlackout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,12 @@ private static void ResetAllCooldown()
{
if (seer.IsAlive())
{
seer.RpcResetAbilityCooldown();
seer.ResetKillCooldown();

if (Main.AllPlayerKillCooldown.TryGetValue(seer.PlayerId, out var kcd))
seer.SetKillCooldown(kcd + 1f);
seer.SetKillCooldown(kcd >= 2f ? kcd - 2f : kcd);

seer.RpcResetAbilityCooldown();
}
else if (seer.HasGhostRole())
{
Expand Down
4 changes: 2 additions & 2 deletions Modules/ExtendedPlayerControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public static void SetKillCooldown(this PlayerControl player, float time = -1f,
gc.KCDTimer = (int)(time / 2);
}
}
else if (forceAnime || !player.IsModded() || !Options.DisableShieldAnimations.GetBool())
else if (forceAnime || !player.IsModded())
{
player.SyncSettings();
player.RpcGuardAndKill(target, fromSetKCD: true);
Expand Down Expand Up @@ -568,7 +568,7 @@ public static void SetKillCooldownV3(this PlayerControl player, float time = -1f
if (target == null) target = player;
if (time >= 0f) Main.AllPlayerKillCooldown[player.PlayerId] = time * 2;
else Main.AllPlayerKillCooldown[player.PlayerId] *= 2;
if (forceAnime || !player.IsModded() || !Options.DisableShieldAnimations.GetBool())
if (forceAnime || !player.IsModded())
{
player.SyncSettings();
player.RpcGuardAndKill(target, fromSetKCD: true);
Expand Down

0 comments on commit 89cee97

Please sign in to comment.