Skip to content

Commit

Permalink
fix: Fix auto-sneak bug
Browse files Browse the repository at this point in the history
bug prevented stamina from refilling and prevented the character from moving except for a small halting blip at a time
  • Loading branch information
afilbert committed Dec 24, 2024
1 parent 45b589f commit 42efe84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Built with [BepInEx](https://valheim.thunderstore.io/package/denikson/BepInExPac

Releases in github repo are packaged for Thunderstore Mod Manager.

* 1.4.1 Fix auto-sneak bug that got stuck at the stam regen threshold
* 1.4.0 Support The Bog Witch update. Add auto-attack feature. Optimize the main loop to prevent toggle lock in certain scenarios
* 1.3.0 Add auto-jump feature and many improvements and tweaks
* Add label to vanilla Auto-run setting in both Gameplay and Accessibility menus that concisely describes the hover text
Expand Down
7 changes: 3 additions & 4 deletions ToggleMovementMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ToggleMovementMod : BaseUnityPlugin
{
const string pluginGUID = "afilbert.ValheimToggleMovementMod";
const string pluginName = "Valheim - Toggle Movement Mod";
const string pluginVersion = "1.4.0";
const string pluginVersion = "1.4.1";
const string freeLookKey = "FreeLook";
const string sprintKey = "Sprint";

Expand Down Expand Up @@ -136,8 +136,7 @@ private static void Prefix(ref Player __instance, ref Vector3 movedir, ref bool
{
Started = true;
}
if (!SprintSet)
{
if (!SprintSet && !Crouching) {
StaminaRefilling = false;
}

Expand Down Expand Up @@ -259,7 +258,7 @@ private static void Prefix(ref Player __instance, ref Vector3 movedir, ref bool
{
AttackStamRefilling = true;
}
if (__instance.GetStaminaPercentage() == 1)
if (__instance.GetStaminaPercentage() >= 1)
{
StaminaRefilling = false;
JumpStamRefilling = false;
Expand Down

0 comments on commit 42efe84

Please sign in to comment.