aswig and multiplayer fixes
This commit is contained in:
parent
d25800eca4
commit
1bdf77e8d6
6 changed files with 102 additions and 49 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue