Skip to content

Commit

Permalink
fix: call IsSwimming() vs InLiquidSwimDepth()
Browse files Browse the repository at this point in the history
InLiquidSwimDepth() appears to have been removed from Player or made private on Character
  • Loading branch information
afilbert committed Jun 17, 2023
1 parent bb80565 commit 89d92d2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Binary file modified Libs/assembly_utils.dll
Binary file not shown.
Binary file modified Libs/assembly_valheim.dll
Binary file not shown.
6 changes: 3 additions & 3 deletions ToggleMovementMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ToggleMovementMod : BaseUnityPlugin
{
const string pluginGUID = "afilbert.ValheimToggleMovementMod";
const string pluginName = "Valheim - Toggle Movement Mod";
const string pluginVersion = "0.1.0";
const string pluginVersion = "0.1.1";
public static ManualLogSource logger;

private readonly Harmony _harmony = new Harmony(pluginGUID);
Expand Down Expand Up @@ -98,13 +98,13 @@ private static void Prefix(ref Player __instance, ref Vector3 movedir, ref bool

bool directionalDown = false;

if (ReequipWeaponAfterSwimming.Value && EquippedItem != null && EquippedItem.m_shared.m_name != "Unarmed" && __instance.InLiquidSwimDepth())
if (ReequipWeaponAfterSwimming.Value && EquippedItem != null && EquippedItem.m_shared.m_name != "Unarmed" && __instance.IsSwimming())
{
ReequipItem = EquippedItem;
}
else
{
if (ReequipWeaponAfterSwimming.Value && ReequipItem != null && !__instance.InLiquidSwimDepth())
if (ReequipWeaponAfterSwimming.Value && ReequipItem != null && !__instance.IsSwimming())
{
__instance.EquipItem(ReequipItem);
ReequipItem = null;
Expand Down
3 changes: 2 additions & 1 deletion ToggleMovementMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
<Reference Include="0Harmony">
<HintPath>Libs\0Harmony.dll</HintPath>
</Reference>
<Reference Include="assembly_utils">
<Reference Include="assembly_utils, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Libs\assembly_utils.dll</HintPath>
</Reference>
<Reference Include="assembly_valheim, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down

0 comments on commit 89d92d2

Please sign in to comment.