Cleans up some shield code, adds grid checks (#12621)
closes https://github.com/space-wizards/space-station-14/issues/11196
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Prototypes;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Blocking;
|
||||
@@ -30,17 +28,13 @@ public sealed class BlockingUserSystem : EntitySystem
|
||||
private void OnParentChanged(EntityUid uid, BlockingUserComponent component, ref EntParentChangedMessage args)
|
||||
{
|
||||
if (TryComp<BlockingComponent>(component.BlockingItem, out var blockComp) && blockComp.IsBlocking)
|
||||
{
|
||||
_blockingSystem.StopBlocking(component.BlockingItem.Value, blockComp, uid);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnInsertAttempt(EntityUid uid, BlockingUserComponent component, ContainerGettingInsertedAttemptEvent args)
|
||||
{
|
||||
if (TryComp<BlockingComponent>(component.BlockingItem, out var blockComp) && blockComp.IsBlocking)
|
||||
{
|
||||
_blockingSystem.StopBlocking(component.BlockingItem.Value, blockComp, uid);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnAnchorChanged(EntityUid uid, BlockingUserComponent component, ref AnchorStateChangedEvent args)
|
||||
@@ -49,17 +43,13 @@ public sealed class BlockingUserSystem : EntitySystem
|
||||
return;
|
||||
|
||||
if (TryComp<BlockingComponent>(component.BlockingItem, out var blockComp) && blockComp.IsBlocking)
|
||||
{
|
||||
_blockingSystem.StopBlocking(component.BlockingItem.Value, blockComp, uid);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDamageChanged(EntityUid uid, BlockingUserComponent component, DamageChangedEvent args)
|
||||
{
|
||||
if (args.DamageDelta != null && args.DamageIncreased)
|
||||
{
|
||||
_damageable.TryChangeDamage(component.BlockingItem, args.DamageDelta, origin: args.Origin);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUserDamageModified(EntityUid uid, BlockingUserComponent component, DamageModifyEvent args)
|
||||
|
||||
Reference in New Issue
Block a user