Open Lukasz825700516 opened 7 months ago
Welp, ill take that as a no then...
You also eat whole bananium stack at once to delete it all rather 10 separately, I think pancakes work just fine though?
Eating pancakes works as they don't leave any leftovers. The issue is that when eating from stack we are executing this branch https://github.com/space-wizards/space-station-14/blob/74b5b72d81bde06052f61e9d7c42b5e45218f2e2/Content.Server/Nutrition/EntitySystems/FoodSystem.cs#L294 that is not creating any leftovers - leftovers are only created upon full item entity consumption https://github.com/space-wizards/space-station-14/blob/74b5b72d81bde06052f61e9d7c42b5e45218f2e2/Content.Server/Nutrition/EntitySystems/FoodSystem.cs#L311
Not sure if this is the right way to fix this but I essentially copied the DeleteAndSpawnTrash function and made it only spawn trash and not delete the stack. It will also place the trash in the user's empty hand if they have an available hand.
public void SpawnTrash(FoodComponent component, EntityUid food, EntityUid user)
{
var ev = new BeforeFullyEatenEvent
{
User = user
};
RaiseLocalEvent(food, ev);
if (ev.Cancelled)
return;
if (string.IsNullOrEmpty(component.Trash))
{
return;
}
// We've been eaten. Become trash.
var position = Transform(food).MapPosition;
var finisher = Spawn(component.Trash, position);
// If the user is holding the stack and has an empty hand.
if (_hands.IsHolding(user, food, out _) && _hands.TryGetEmptyHand(user, out var emptyHand))
{
// Put the trash in the user's empty hand.
_hands.TryPickup(user, finisher, emptyHand);
}
}
Called this after the stack.count > 1 if statement and its working so far.
Eating from bananium stack doesn't leave on the ground multiple nananium peels.
Originally posted by @thebadman4662 in https://github.com/space-wizards/space-station-14/issues/25308#issuecomment-1949580337