Files
OldThink/Content.Shared/Projectiles/ProjectileSystem.cs

24 lines
678 B
C#
Raw Normal View History

using Robust.Shared.GameObjects;
using Robust.Shared.Physics.Dynamics;
2021-06-09 22:19:39 +02:00
namespace Content.Shared.Projectiles
{
public sealed class ProjectileSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SharedProjectileComponent, PreventCollideEvent>(PreventCollision);
}
private void PreventCollision(EntityUid uid, SharedProjectileComponent component, PreventCollideEvent args)
{
if (component.IgnoreShooter && args.BodyB.OwnerUid == component.Shooter)
{
args.Cancel();
return;
}
}
}
}