Stop eating food if you drop it (#29854)
* Stop eating food if you drop it * woops, unused param * comments --------- Co-authored-by: plykiya <plykiya@protonmail.com>
This commit is contained in:
@@ -99,6 +99,9 @@ public sealed class FoodSystem : EntitySystem
|
||||
args.Handled = result.Handled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to feed the food item to the target entity
|
||||
/// </summary>
|
||||
public (bool Success, bool Handled) TryFeed(EntityUid user, EntityUid target, EntityUid food, FoodComponent foodComp)
|
||||
{
|
||||
//Suppresses eating yourself and alive mobs
|
||||
@@ -189,9 +192,9 @@ public sealed class FoodSystem : EntitySystem
|
||||
BreakOnDamage = true,
|
||||
MovementThreshold = 0.01f,
|
||||
DistanceThreshold = MaxFeedDistance,
|
||||
// Mice and the like can eat without hands.
|
||||
// TODO maybe set this based on some CanEatWithoutHands event or component?
|
||||
NeedHand = forceFeed,
|
||||
// do-after will stop if item is dropped when trying to feed someone else
|
||||
// or if the item started out in the user's own hands
|
||||
NeedHand = forceFeed || _hands.IsHolding(user, food),
|
||||
};
|
||||
|
||||
_doAfter.TryStartDoAfter(doAfterArgs);
|
||||
|
||||
Reference in New Issue
Block a user