diff --git a/JotunnModStub/Aswid/AswidRace.cs b/JotunnModStub/Aswid/AswidRace.cs index 2fbd363..2610425 100644 --- a/JotunnModStub/Aswid/AswidRace.cs +++ b/JotunnModStub/Aswid/AswidRace.cs @@ -1085,6 +1085,28 @@ namespace RacesOfValheim // If stomach is full, EatFood fails, UseItem does not consume the item, and virtualInv is destroyed (disintegrated) AswidRace.BypassAswidFoodCheck = true; bool successfullyEaten = Player.m_localPlayer.EatFood(addedItem); + + // Force-feed logic for aura executions + if (!successfullyEaten && bypassCooldown) + { + var m_foods = HarmonyLib.Traverse.Create(Player.m_localPlayer).Field("m_foods").GetValue>(); + if (m_foods != null) + { + Player.Food existing = m_foods.Find(f => f.m_item.m_shared.m_name == addedItem.m_shared.m_name); + if (existing != null) + { + m_foods.Remove(existing); + } + else if (m_foods.Count >= 3) + { + m_foods.Sort((a, b) => (b.m_time / b.m_item.m_shared.m_foodBurnTime).CompareTo(a.m_time / a.m_item.m_shared.m_foodBurnTime)); + m_foods.RemoveAt(0); // Remove the most digested food + } + successfullyEaten = Player.m_localPlayer.EatFood(addedItem); + Jotunn.Logger.LogInfo($"[AswidDebug] Force-feed attempted. Result: {successfullyEaten}"); + } + } + AswidRace.BypassAswidFoodCheck = false; if (successfullyEaten)