From 1c44d95c2b10fbc1e1bafc36b0d9982f8ad8970d Mon Sep 17 00:00:00 2001 From: Whatstone <166147148+whatston3@users.noreply.github.com> Date: Mon, 1 Jun 2026 16:56:21 -0400 Subject: [PATCH] Bugfix: Banana cream pies stun when target is already creamed (#44209) OnCreamPiedHitBy: Paralyze before exit --- .../Nutrition/EntitySystems/SharedCreamPieSystem.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Nutrition/EntitySystems/SharedCreamPieSystem.cs b/Content.Shared/Nutrition/EntitySystems/SharedCreamPieSystem.cs index b8283e234f..67988072dc 100644 --- a/Content.Shared/Nutrition/EntitySystems/SharedCreamPieSystem.cs +++ b/Content.Shared/Nutrition/EntitySystems/SharedCreamPieSystem.cs @@ -118,12 +118,17 @@ public abstract partial class SharedCreamPieSystem : EntitySystem private void OnCreamPiedHitBy(Entity creamPied, ref ThrowHitByEvent args) { - if (creamPied.Comp.CreamPied || !Exists(args.Thrown) || !TryComp(args.Thrown, out var creamPie)) + if (!Exists(args.Thrown) || !TryComp(args.Thrown, out var creamPie)) + return; + + _stunSystem.TryUpdateParalyzeDuration(creamPied.Owner, creamPie.ParalyzeTime); + + // Already creamed, no need to spam popups. + if (creamPied.Comp.CreamPied) return; // TODO: Check if they even have a head that can be hit. SetCreamPied(creamPied.AsNullable(), true); - _stunSystem.TryUpdateParalyzeDuration(creamPied.Owner, creamPie.ParalyzeTime); // Throwing is not predicted, so the thrower is not equal to the client predicting the collision, so we cannot pass in a user. // TODO: Make the popup API sane.