Bugfix: Banana cream pies stun when target is already creamed (#44209)

OnCreamPiedHitBy: Paralyze before exit
This commit is contained in:
Whatstone
2026-06-01 16:56:21 -04:00
committed by GitHub
parent 7b022c09a5
commit 1c44d95c2b
@@ -118,12 +118,17 @@ public abstract partial class SharedCreamPieSystem : EntitySystem
private void OnCreamPiedHitBy(Entity<CreamPiedComponent> creamPied, ref ThrowHitByEvent args)
{
if (creamPied.Comp.CreamPied || !Exists(args.Thrown) || !TryComp<CreamPieComponent>(args.Thrown, out var creamPie))
if (!Exists(args.Thrown) || !TryComp<CreamPieComponent>(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.