Bullet flyby sounds (#8317)

This commit is contained in:
metalgearsloth
2022-05-21 18:04:47 +10:00
committed by GitHub
parent 850eebcabc
commit 4e2b94199e
16 changed files with 181 additions and 4 deletions

View File

@@ -0,0 +1,24 @@
using Robust.Shared.Physics.Dynamics;
namespace Content.Shared.Projectiles
{
public abstract class SharedProjectileSystem : EntitySystem
{
public const string ProjectileFixture = "projectile";
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SharedProjectileComponent, PreventCollideEvent>(PreventCollision);
}
private void PreventCollision(EntityUid uid, SharedProjectileComponent component, PreventCollideEvent args)
{
if (component.IgnoreShooter && args.BodyB.Owner == component.Shooter)
{
args.Cancel();
return;
}
}
}
}