Fix sliding bug (#24846)

* Fix slip bug

* debug assert

* count

* DebugAssert

(cherry picked from commit 9e484c4b61352a81bb84e2e1e9e030d13ff1464a)
This commit is contained in:
Arendian 2024-02-03 09:10:50 +01:00 committed by Debug
parent 48bcdcd39b
commit d6cb163db3
No known key found for this signature in database
GPG Key ID: 271270A74EF9C350
2 changed files with 6 additions and 2 deletions

View File

@ -59,5 +59,4 @@ public sealed class SlidingSystem : EntitySystem
Dirty(uid, component);
}
}

View File

@ -9,6 +9,7 @@ using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Utility;
namespace Content.Shared.Slippery;
@ -75,7 +76,11 @@ public sealed class SlipperySystem : EntitySystem
_physics.SetLinearVelocity(other, physics.LinearVelocity * component.LaunchForwardsMultiplier, body: physics);
if (component.SuperSlippery)
EnsureComp<SlidingComponent>(other);
{
var sliding = EnsureComp<SlidingComponent>(other);
sliding.CollidingEntities.Add(uid);
DebugTools.Assert(_physics.GetContactingEntities(other, physics).Contains(uid));
}
}
var playSound = !_statusEffects.HasStatusEffect(other, "KnockedDown");