Fixes EatVerb interaction range (#5505)
This commit is contained in:
@@ -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;
|
return false;
|
||||||
|
|
||||||
var transferAmount = component.TransferAmount != null ? FixedPoint2.Min((FixedPoint2) component.TransferAmount, solution.CurrentVolume) : solution.CurrentVolume;
|
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...
|
//TODO: DoAfter based on delay after food & drinks delay PR merged...
|
||||||
private void AddEatVerb(EntityUid uid, FoodComponent component, GetInteractionVerbsEvent ev)
|
private void AddEatVerb(EntityUid uid, FoodComponent component, GetInteractionVerbsEvent ev)
|
||||||
{
|
{
|
||||||
Logger.DebugS("action", "triggered");
|
|
||||||
if (!ev.CanInteract ||
|
if (!ev.CanInteract ||
|
||||||
|
!ev.CanAccess ||
|
||||||
!EntityManager.TryGetComponent(ev.User.Uid, out SharedBodyComponent? body) ||
|
!EntityManager.TryGetComponent(ev.User.Uid, out SharedBodyComponent? body) ||
|
||||||
!_bodySystem.TryGetComponentsOnMechanisms<StomachComponent>(ev.User.Uid, out var stomachs, body))
|
!_bodySystem.TryGetComponentsOnMechanisms<StomachComponent>(ev.User.Uid, out var stomachs, body))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user