Replace obsolete EntityWhitelist IsValid usages part 2 (#28506)

This commit is contained in:
Plykiya
2024-06-08 20:03:26 +02:00
committed by null
parent 5ec48e7784
commit 6583105f10
42 changed files with 141 additions and 91 deletions
@@ -1,4 +1,5 @@
using Content.Shared.Movement.Components;
using Content.Shared.Whitelist;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Events;
using Robust.Shared.Physics.Systems;
@@ -9,6 +10,7 @@ public sealed class SpeedModifierContactsSystem : EntitySystem
{
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly MovementSpeedModifierSystem _speedModifierSystem = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
// TODO full-game-save
// Either these need to be processed before a map is saved, or slowed/slowing entities need to update on init.
@@ -86,7 +88,7 @@ public sealed class SpeedModifierContactsSystem : EntitySystem
if (!TryComp<SpeedModifierContactsComponent>(ent, out var slowContactsComponent))
continue;
if (slowContactsComponent.IgnoreWhitelist != null && slowContactsComponent.IgnoreWhitelist.IsValid(uid))
if (_whitelistSystem.IsWhitelistPass(slowContactsComponent.IgnoreWhitelist, uid))
continue;
walkSpeed += slowContactsComponent.WalkSpeedModifier;