Changed drinks to use ECS (#4948)
Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Server.Hands.Components;
|
||||
using Content.Server.Items;
|
||||
using Content.Server.Nutrition.Components;
|
||||
using Content.Server.Nutrition.EntitySystems;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
@@ -57,9 +58,8 @@ namespace Content.Server.AI.Operators.Nutrition
|
||||
return Outcome.Failed;
|
||||
}
|
||||
|
||||
if (drinkComponent.Deleted ||
|
||||
drinkComponent.Empty ||
|
||||
_owner.TryGetComponent(out ThirstComponent? thirstComponent) &&
|
||||
if (drinkComponent.Deleted || EntitySystem.Get<DrinkSystem>().IsEmpty(drinkComponent.Owner.Uid, drinkComponent)
|
||||
|| _owner.TryGetComponent(out ThirstComponent? thirstComponent) &&
|
||||
thirstComponent.CurrentThirst >= thirstComponent.ThirstThresholds[ThirstThreshold.Okay])
|
||||
{
|
||||
return Outcome.Success;
|
||||
|
||||
Reference in New Issue
Block a user