fix feeding unremovable items (#21234)

This commit is contained in:
Nemanja
2023-10-25 00:51:32 -04:00
committed by GitHub
parent 4b10cab617
commit 6e007b0d0b

View File

@@ -17,6 +17,7 @@ using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems; using Content.Shared.Hands.EntitySystems;
using Content.Shared.IdentityManagement; using Content.Shared.IdentityManagement;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Interaction.Components;
using Content.Shared.Interaction.Events; using Content.Shared.Interaction.Events;
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Content.Shared.Mobs.Systems; using Content.Shared.Mobs.Systems;
@@ -101,6 +102,9 @@ public sealed class FoodSystem : EntitySystem
if (!TryComp<BodyComponent>(target, out var body)) if (!TryComp<BodyComponent>(target, out var body))
return (false, false); return (false, false);
if (HasComp<UnremoveableComponent>(food))
return (false, false);
if (_openable.IsClosed(food, user)) if (_openable.IsClosed(food, user))
return (false, true); return (false, true);