Add item checking for moth food (#30019)
* Add ContainerContainer component checking for moth food * Use ItemSlotsComponent checking on food item
This commit is contained in:
@@ -10,7 +10,6 @@ using Content.Shared.Administration.Logs;
|
|||||||
using Content.Shared.Body.Components;
|
using Content.Shared.Body.Components;
|
||||||
using Content.Shared.Body.Organ;
|
using Content.Shared.Body.Organ;
|
||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.Chemistry.Reagent;
|
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.DoAfter;
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.FixedPoint;
|
using Content.Shared.FixedPoint;
|
||||||
@@ -31,6 +30,7 @@ using Robust.Shared.Audio;
|
|||||||
using Robust.Shared.Audio.Systems;
|
using Robust.Shared.Audio.Systems;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Content.Shared.Containers.ItemSlots;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Content.Shared.Whitelist;
|
using Content.Shared.Whitelist;
|
||||||
|
|
||||||
@@ -138,6 +138,16 @@ public sealed class FoodSystem : EntitySystem
|
|||||||
return (false, true);
|
return (false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Checks for used item slots
|
||||||
|
if (TryComp<ItemSlotsComponent>(food, out var itemSlots))
|
||||||
|
{
|
||||||
|
if (itemSlots.Slots.Any(slot => slot.Value.HasItem))
|
||||||
|
{
|
||||||
|
_popup.PopupEntity(Loc.GetString("food-has-used-storage", ("food", food)), user, user);
|
||||||
|
return (false, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var flavors = _flavorProfile.GetLocalizedFlavorsMessage(food, user, foodSolution);
|
var flavors = _flavorProfile.GetLocalizedFlavorsMessage(food, user, foodSolution);
|
||||||
|
|
||||||
if (GetUsesRemaining(food, foodComp) <= 0)
|
if (GetUsesRemaining(food, foodComp) <= 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user