Don't allow adminfrozen entities to be pulled (#8205)

This commit is contained in:
metalgearsloth
2022-05-16 22:24:52 +10:00
committed by GitHub
parent 527eabc677
commit 644277bf6f
5 changed files with 40 additions and 19 deletions

View File

@@ -26,12 +26,12 @@ namespace Content.Shared.Pulling
return false;
}
if (!EntityManager.TryGetComponent<IPhysBody?>(pulled, out var _physics))
if (!EntityManager.TryGetComponent<IPhysBody>(pulled, out var physics))
{
return false;
}
if (_physics.BodyType == BodyType.Static)
if (physics.BodyType == BodyType.Static)
{
return false;
}
@@ -113,12 +113,12 @@ namespace Content.Shared.Pulling
return false;
}
if (!EntityManager.TryGetComponent<PhysicsComponent?>(puller.Owner, out var pullerPhysics))
if (!EntityManager.TryGetComponent<PhysicsComponent>(puller.Owner, out var pullerPhysics))
{
return false;
}
if (!EntityManager.TryGetComponent<PhysicsComponent?>(pullable.Owner, out var pullablePhysics))
if (!EntityManager.TryGetComponent<PhysicsComponent>(pullable.Owner, out var pullablePhysics))
{
return false;
}
@@ -158,7 +158,7 @@ namespace Content.Shared.Pulling
// Continue with pulling process.
var pullAttempt = new PullAttemptMessage(pullerPhysics, pullablePhysics);
var pullAttempt = new PullAttemptEvent(pullerPhysics, pullablePhysics);
RaiseLocalEvent(puller.Owner, pullAttempt, broadcast: false);