Revert force-feed logic to respect Aswid stomach limitations

This commit is contained in:
Ferdinando 2026-07-31 09:31:43 +02:00
commit ad74ca3219

View file

@ -1085,28 +1085,6 @@ namespace RacesOfValheim
// If stomach is full, EatFood fails, UseItem does not consume the item, and virtualInv is destroyed (disintegrated) // If stomach is full, EatFood fails, UseItem does not consume the item, and virtualInv is destroyed (disintegrated)
AswidRace.BypassAswidFoodCheck = true; AswidRace.BypassAswidFoodCheck = true;
bool successfullyEaten = Player.m_localPlayer.EatFood(addedItem); 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<System.Collections.Generic.List<Player.Food>>();
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; AswidRace.BypassAswidFoodCheck = false;
if (successfullyEaten) if (successfullyEaten)