From 99b431cafd3312ff5bdfeb0ecc618b12b5718405 Mon Sep 17 00:00:00 2001 From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Sun, 20 Jul 2025 14:35:49 -0700 Subject: [PATCH] Crawling Fix 3: OOPS!!! (#39089) Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- .../Stunnable/SharedStunSystem.Knockdown.cs | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/Content.Shared/Stunnable/SharedStunSystem.Knockdown.cs b/Content.Shared/Stunnable/SharedStunSystem.Knockdown.cs index bd8347ecbf..d609acff04 100644 --- a/Content.Shared/Stunnable/SharedStunSystem.Knockdown.cs +++ b/Content.Shared/Stunnable/SharedStunSystem.Knockdown.cs @@ -87,8 +87,7 @@ public abstract partial class SharedStunSystem if (!knockedDown.AutoStand || knockedDown.DoAfterId.HasValue || knockedDown.NextUpdate > GameTiming.CurTime) continue; - TryStanding(uid, out knockedDown.DoAfterId); - DirtyField(uid, knockedDown, nameof(KnockedDownComponent.DoAfterId)); + TryStanding(uid); } } @@ -135,7 +134,7 @@ public abstract partial class SharedStunSystem return; entity.Comp.AutoStand = autoStand; - DirtyField(entity, entity.Comp, nameof(entity.Comp.AutoStand)); + DirtyField(entity, entity.Comp, nameof(KnockedDownComponent.AutoStand)); } /// @@ -250,21 +249,16 @@ public abstract partial class SharedStunSystem var stand = !component.DoAfterId.HasValue; SetAutoStand(playerEnt, stand); - if (stand && TryStanding(playerEnt, out component.DoAfterId)) - DirtyField(playerEnt, component, nameof(KnockedDownComponent.DoAfterId)); - else + if (!stand || !TryStanding(playerEnt)) CancelKnockdownDoAfter((playerEnt, component)); } - public bool TryStanding(Entity entity, out ushort? id) + public bool TryStanding(Entity entity) { - id = null; // If we aren't knocked down or can't be knocked down, then we did technically succeed in standing up if (!Resolve(entity, ref entity.Comp1, ref entity.Comp2, false)) return true; - id = entity.Comp1.DoAfterId; - if (!TryStand((entity.Owner, entity.Comp1))) return false; @@ -284,7 +278,8 @@ public abstract partial class SharedStunSystem if (!DoAfter.TryStartDoAfter(doAfterArgs, out var doAfterId)) return false; - id = doAfterId.Value.Index; + entity.Comp1.DoAfterId = doAfterId.Value.Index; + DirtyField(entity, entity.Comp1, nameof(KnockedDownComponent.DoAfterId)); return true; } @@ -306,7 +301,7 @@ public abstract partial class SharedStunSystem RaiseLocalEvent(entity, ref ev); if (ev.Autostand != entity.Comp.AutoStand) - SetAutoStand(entity!, ev.Autostand); + SetAutoStand((entity.Owner, entity.Comp), ev.Autostand); if (ev.Message != null) { @@ -369,10 +364,9 @@ public abstract partial class SharedStunSystem return; // If we're already trying to stand, or we fail to stand try forcing it - if (!TryStanding(entity.Owner, out entity.Comp.DoAfterId)) - ForceStandUp(entity!); + if (!TryStanding(entity.Owner)) + ForceStandUp((entity.Owner, entity.Comp)); - DirtyField(entity, entity.Comp, nameof(KnockedDownComponent.DoAfterId)); args.Handled = true; } -- 2.52.0