aswig and multiplayer fixes

This commit is contained in:
Ferdinando 2026-08-02 17:54:39 +02:00
commit 1bdf77e8d6
6 changed files with 102 additions and 49 deletions

View file

@ -804,4 +804,24 @@ namespace RacesOfValheim
}
}
}
[HarmonyPatch(typeof(Player), "ClearFood")]
public static class Aswid_Player_ClearFood_Patch
{
public static bool Prefix(Player __instance)
{
if (__instance == Player.m_localPlayer && AswidRace.IsAswid())
{
// Retain food if the player is dead/dying.
// Allows Bukeperries to still clear food normally.
if (__instance.IsDead() || __instance.GetHealth() <= 0f)
{
Jotunn.Logger.LogInfo("[AswidRace] Preserving food buffs through death (Aswid racial trait).");
return false;
}
}
return true;
}
}
}