Crawling Fix 3: OOPS!!! (#39089)

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
Princess Cheeseballs
2025-07-20 14:35:49 -07:00
committed by GitHub
parent 267d92a1ea
commit 99b431cafd

View File

@@ -87,8 +87,7 @@ public abstract partial class SharedStunSystem
if (!knockedDown.AutoStand || knockedDown.DoAfterId.HasValue || knockedDown.NextUpdate > GameTiming.CurTime) if (!knockedDown.AutoStand || knockedDown.DoAfterId.HasValue || knockedDown.NextUpdate > GameTiming.CurTime)
continue; continue;
TryStanding(uid, out knockedDown.DoAfterId); TryStanding(uid);
DirtyField(uid, knockedDown, nameof(KnockedDownComponent.DoAfterId));
} }
} }
@@ -135,7 +134,7 @@ public abstract partial class SharedStunSystem
return; return;
entity.Comp.AutoStand = autoStand; entity.Comp.AutoStand = autoStand;
DirtyField(entity, entity.Comp, nameof(entity.Comp.AutoStand)); DirtyField(entity, entity.Comp, nameof(KnockedDownComponent.AutoStand));
} }
/// <summary> /// <summary>
@@ -250,21 +249,16 @@ public abstract partial class SharedStunSystem
var stand = !component.DoAfterId.HasValue; var stand = !component.DoAfterId.HasValue;
SetAutoStand(playerEnt, stand); SetAutoStand(playerEnt, stand);
if (stand && TryStanding(playerEnt, out component.DoAfterId)) if (!stand || !TryStanding(playerEnt))
DirtyField(playerEnt, component, nameof(KnockedDownComponent.DoAfterId));
else
CancelKnockdownDoAfter((playerEnt, component)); CancelKnockdownDoAfter((playerEnt, component));
} }
public bool TryStanding(Entity<KnockedDownComponent?, StandingStateComponent?> entity, out ushort? id) public bool TryStanding(Entity<KnockedDownComponent?, StandingStateComponent?> entity)
{ {
id = null;
// If we aren't knocked down or can't be knocked down, then we did technically succeed in standing up // 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)) if (!Resolve(entity, ref entity.Comp1, ref entity.Comp2, false))
return true; return true;
id = entity.Comp1.DoAfterId;
if (!TryStand((entity.Owner, entity.Comp1))) if (!TryStand((entity.Owner, entity.Comp1)))
return false; return false;
@@ -284,7 +278,8 @@ public abstract partial class SharedStunSystem
if (!DoAfter.TryStartDoAfter(doAfterArgs, out var doAfterId)) if (!DoAfter.TryStartDoAfter(doAfterArgs, out var doAfterId))
return false; return false;
id = doAfterId.Value.Index; entity.Comp1.DoAfterId = doAfterId.Value.Index;
DirtyField(entity, entity.Comp1, nameof(KnockedDownComponent.DoAfterId));
return true; return true;
} }
@@ -306,7 +301,7 @@ public abstract partial class SharedStunSystem
RaiseLocalEvent(entity, ref ev); RaiseLocalEvent(entity, ref ev);
if (ev.Autostand != entity.Comp.AutoStand) if (ev.Autostand != entity.Comp.AutoStand)
SetAutoStand(entity!, ev.Autostand); SetAutoStand((entity.Owner, entity.Comp), ev.Autostand);
if (ev.Message != null) if (ev.Message != null)
{ {
@@ -369,10 +364,9 @@ public abstract partial class SharedStunSystem
return; return;
// If we're already trying to stand, or we fail to stand try forcing it // If we're already trying to stand, or we fail to stand try forcing it
if (!TryStanding(entity.Owner, out entity.Comp.DoAfterId)) if (!TryStanding(entity.Owner))
ForceStandUp(entity!); ForceStandUp((entity.Owner, entity.Comp));
DirtyField(entity, entity.Comp, nameof(KnockedDownComponent.DoAfterId));
args.Handled = true; args.Handled = true;
} }