From 1bb82f6fa0fe19679a00a596baa1f3178736f8bb Mon Sep 17 00:00:00 2001 From: Velken <8467292+Velken@users.noreply.github.com> Date: Sat, 25 Jul 2026 01:02:50 -0300 Subject: [PATCH] Add check if mouth is covered for changeling devour (#44677) * no more eating in solars * forgor to remove unused import * address review * clean --------- Co-authored-by: ScarKy0 --- .../Nutrition/EntitySystems/IngestionSystem.API.cs | 13 ++++++++++++- .../Nutrition/EntitySystems/IngestionSystem.cs | 2 +- Resources/Prototypes/Actions/changeling.yml | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Nutrition/EntitySystems/IngestionSystem.API.cs b/Content.Shared/Nutrition/EntitySystems/IngestionSystem.API.cs index 3c8dbb9e74..0287109966 100644 --- a/Content.Shared/Nutrition/EntitySystems/IngestionSystem.API.cs +++ b/Content.Shared/Nutrition/EntitySystems/IngestionSystem.API.cs @@ -58,12 +58,23 @@ public sealed partial class IngestionSystem return AttemptIngest(user, user, ingested, false); } + /// + /// Check if the action user has an unblocked mouth. + /// + /// The mouth action's user to check + /// The slots to check that are not being blocked. + /// True if the user has a free mouth, otherwise False + public bool HasMouthAvailable(EntityUid user, SlotFlags flags = DefaultFlags) + { + return HasMouthAvailable(user, user, flags); + } + /// /// Check whether we have an open pie-hole that's in range. /// /// The one performing the action /// The target whose mouth is checked - /// + /// True if the user has a free mouth that can reach the target, otherwise False public bool HasMouthAvailable(EntityUid user, EntityUid target) { return HasMouthAvailable(user, target, DefaultFlags); diff --git a/Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs b/Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs index 48dddc2139..add2ce186a 100644 --- a/Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs +++ b/Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs @@ -543,7 +543,7 @@ public sealed partial class IngestionSystem : EntitySystem private void OnMouthUncoveredActionAttempt(Entity ent, ref ActionAttemptEvent args) { - if (!HasMouthAvailable(args.User, args.User, ent.Comp.Slots)) + if (!HasMouthAvailable(args.User, ent.Comp.Slots)) args.Cancelled = true; } } diff --git a/Resources/Prototypes/Actions/changeling.yml b/Resources/Prototypes/Actions/changeling.yml index 464513ec42..4a10e759db 100644 --- a/Resources/Prototypes/Actions/changeling.yml +++ b/Resources/Prototypes/Actions/changeling.yml @@ -47,6 +47,7 @@ iconOn: { sprite : Interface/Actions/changeling.rsi, state: "devour_on" } itemIconStyle: BigAction priority: 1 + - type: ActionRequireMouthUncovered - type: TargetAction - type: EntityTargetAction event: !type:ChangelingDevourActionEvent