Replace obsolete EntityWhitelist IsValid usages (#28465)
* Replace obsolete whitelist is valid with whitelist system * Consistency * Fix logic * Bork * I figured out how to get whitelists on the client lol * test fail * woops * HELP ME FUNCTIONS * Fix errors * simplify --------- Co-authored-by: plykiya <plykiya@protonmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Projectiles;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Network;
|
||||
@@ -15,6 +16,7 @@ public abstract class SharedDamageMarkerSystem : EntitySystem
|
||||
[Dependency] private readonly INetManager _netManager = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -58,7 +60,7 @@ public abstract class SharedDamageMarkerSystem : EntitySystem
|
||||
if (!args.OtherFixture.Hard ||
|
||||
args.OurFixtureId != SharedProjectileSystem.ProjectileFixture ||
|
||||
component.Amount <= 0 ||
|
||||
component.Whitelist?.IsValid(args.OtherEntity, EntityManager) == false ||
|
||||
_whitelistSystem.IsWhitelistFail(component.Whitelist, args.OtherEntity) ||
|
||||
!TryComp<ProjectileComponent>(uid, out var projectile) ||
|
||||
projectile.Weapon == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user