Skip to content

Commit

Permalink
fix: remove IsOwner conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw committed Feb 13, 2024
1 parent ebb1ad3 commit 50112d7
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions lc-hax/Scripts/Commands/HealCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,44 +51,38 @@ void RespawnLocalPlayer(PlayerControllerB localPlayer, StartOfRound startOfRound
localPlayer.health = 100;
localPlayer.mapRadarDotAnimator?.SetBool("dead", false);

if (localPlayer.IsOwner) {
if (hudManager.TryGetComponent(out Animator gasHelmetAnimator)) {
gasHelmetAnimator.SetBool("gasEmitting", false);
}

localPlayer.hasBegunSpectating = false;
hudManager.RemoveSpectateUI();

if (hudManager.TryGetComponent(out Animator gameOverAnimator)) {
gameOverAnimator.SetTrigger("revive");
}

localPlayer.hinderedMultiplier = 1.0f;
localPlayer.isMovementHindered = 0;
localPlayer.sourcesCausingSinking = 0;
localPlayer.reverbPreset = startOfRound.shipReverb;
if (hudManager.TryGetComponent(out Animator gasHelmetAnimator)) {
gasHelmetAnimator.SetBool("gasEmitting", false);
}

soundManager.earsRingingTimer = 0.0f;
localPlayer.hasBegunSpectating = false;
hudManager.RemoveSpectateUI();

if (hudManager.TryGetComponent(out Animator gameOverAnimator)) {
gameOverAnimator.SetTrigger("revive");
}

localPlayer.hinderedMultiplier = 1.0f;
localPlayer.isMovementHindered = 0;
localPlayer.sourcesCausingSinking = 0;
localPlayer.reverbPreset = startOfRound.shipReverb;
localPlayer.voiceMuffledByEnemy = false;

soundManager.earsRingingTimer = 0.0f;
soundManager.playerVoicePitchTargets[localPlayer.playerClientId] = 1.0f;
soundManager.SetPlayerPitch(1.0f, localPlayer.PlayerIndex());

if (localPlayer.currentVoiceChatIngameSettings == null) {
startOfRound.RefreshPlayerVoicePlaybackObjects();
}

if (localPlayer.currentVoiceChatIngameSettings != null) {
if (localPlayer.currentVoiceChatIngameSettings.voiceAudio == null) {
localPlayer.currentVoiceChatIngameSettings.InitializeComponents();
}
localPlayer.currentVoiceChatIngameSettings?.InitializeComponents();

if (localPlayer.currentVoiceChatIngameSettings.voiceAudio is AudioSource voiceAudio) {
if (voiceAudio.TryGetComponent(out OccludeAudio occludeAudio)) {
occludeAudio.overridingLowPass = false;
}
}
if (localPlayer.currentVoiceChatIngameSettings?.voiceAudio?.TryGetComponent(out OccludeAudio occludeAudio) is not true) {
return;
}

occludeAudio.overridingLowPass = false;
}

Result HealLocalPlayer(HUDManager hudManager, StartOfRound startOfRound) {
Expand Down

1 comment on commit 50112d7

@joep26020
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soooo what does this do lol

Please sign in to comment.