From e94bd5698df69fb46d60e58b707e3b5aee871ceb Mon Sep 17 00:00:00 2001 From: FoLoKe <36813380+FoLoKe@users.noreply.github.com> Date: Thu, 25 Nov 2021 05:16:56 +0300 Subject: [PATCH] Fixes EatVerb interaction range (#5505) --- Content.Server/Nutrition/EntitySystems/FoodSystem.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 64cc4c44ef..d8201824a6 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -126,7 +126,8 @@ namespace Content.Server.Nutrition.EntitySystems } } - if (userUid != targetUid && !userUid.InRangeUnobstructed(targetUid, popup: true)) + if (!userUid.InRangeUnobstructed(uid, popup: true) || + userUid != targetUid && !userUid.InRangeUnobstructed(targetUid, popup: true)) return false; var transferAmount = component.TransferAmount != null ? FixedPoint2.Min((FixedPoint2) component.TransferAmount, solution.CurrentVolume) : solution.CurrentVolume; @@ -198,8 +199,8 @@ namespace Content.Server.Nutrition.EntitySystems //TODO: DoAfter based on delay after food & drinks delay PR merged... private void AddEatVerb(EntityUid uid, FoodComponent component, GetInteractionVerbsEvent ev) { - Logger.DebugS("action", "triggered"); if (!ev.CanInteract || + !ev.CanAccess || !EntityManager.TryGetComponent(ev.User.Uid, out SharedBodyComponent? body) || !_bodySystem.TryGetComponentsOnMechanisms(ev.User.Uid, out var stomachs, body)) return;