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:
Fortune117
2021-11-02 11:40:55 +11:00
committed by GitHub
parent afc19aff32
commit 76bc00b218
4 changed files with 194 additions and 201 deletions

View File

@@ -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;