add whitelist support for slow contacts (#11647)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
@@ -11,6 +12,9 @@ public sealed class SlowContactsComponent : Component
|
||||
|
||||
[ViewVariables, DataField("sprintSpeedModifier")]
|
||||
public float SprintSpeedModifier { get; set; } = 1.0f;
|
||||
|
||||
[DataField("ignoreWhitelist")]
|
||||
public EntityWhitelist? IgnoreWhitelist;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Content.Shared.Movement.Components;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
using Robust.Shared.Physics.Events;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
|
||||
@@ -76,6 +75,9 @@ public sealed class SlowContactsSystem : EntitySystem
|
||||
if (!TryComp<SlowContactsComponent>(ent, out var slowContactsComponent))
|
||||
continue;
|
||||
|
||||
if (slowContactsComponent.IgnoreWhitelist != null && slowContactsComponent.IgnoreWhitelist.IsValid(ent))
|
||||
continue;
|
||||
|
||||
walkSpeed = Math.Min(walkSpeed, slowContactsComponent.WalkSpeedModifier);
|
||||
sprintSpeed = Math.Min(sprintSpeed, slowContactsComponent.SprintSpeedModifier);
|
||||
remove = false;
|
||||
|
||||
Reference in New Issue
Block a user