Skip to content

Commit

Permalink
fix: jump height no longer resets on death or returning to lobby
Browse files Browse the repository at this point in the history
  • Loading branch information
TisRyno committed Apr 11, 2024
1 parent 659bc0f commit e57095a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions LethalProgression/Patches/StartOfRoundPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using HarmonyLib;
using LethalProgression.Skills;

namespace LethalProgression.Patches
{

[HarmonyPatch]
internal class StartOfRoundPatch
{
[HarmonyPrefix]
[HarmonyPatch(typeof(StartOfRound), "ResetMiscValues")]
private static void ResetMiscValues_PrePatch()
{
JumpHeight.JumpHeightUpdate(0);
}

[HarmonyPrefix]
[HarmonyPatch(typeof(StartOfRound), "OnShipLandedMiscEvents")]
private static void OnShipLandedMiscEvents_PrePatch()
{
JumpHeight.JumpHeightUpdate(0);
}
}
}
2 changes: 1 addition & 1 deletion LethalProgression/Skills/JumpHeight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static void JumpHeightUpdate(int updatedValue)
jumpSkillValue = skill.GetLevel()
};

LethalPlugin.Log.LogInfo($"Jump skill now {updatedValue}, sending to Server");
LethalPlugin.Log.LogInfo($"Jump skill now {skill.GetLevel()}, sending to Server");

LP_NetworkManager.xpInstance.updatePlayerJumpForceClientMessage.SendServer(networkData);
}
Expand Down

0 comments on commit e57095a

Please sign in to comment.