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,6 +1,7 @@
using Content.Server.Polymorph.Components;
using Content.Shared.Polymorph;
using Content.Shared.Projectiles;
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.Physics.Events;
using Robust.Shared.Prototypes;
@@ -9,6 +10,8 @@ namespace Content.Server.Polymorph.Systems;
public partial class PolymorphSystem
{
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
/// <summary>
/// Need to do this so we don't get a collection enumeration error in physics by polymorphing
/// an entity we're colliding with
@@ -39,8 +42,8 @@ public partial class PolymorphSystem
return;
var other = args.OtherEntity;
if (!component.Whitelist.IsValid(other, EntityManager)
|| component.Blacklist != null && component.Blacklist.IsValid(other, EntityManager))
if (_whitelistSystem.IsWhitelistFail(component.Whitelist, other) ||
_whitelistSystem.IsBlacklistPass(component.Blacklist, other))
return;
_queuedPolymorphUpdates.Enqueue(new (other, component.Sound, component.Polymorph));