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

@@ -4,6 +4,7 @@ using Content.Shared.Body.Components;
using Content.Shared.Camera;
using Content.Shared.Damage;
using Content.Shared.Database;
using Content.Shared.Projectiles;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
@@ -13,7 +14,7 @@ using Robust.Shared.Player;
namespace Content.Server.Projectiles
{
[UsedImplicitly]
internal sealed class ProjectileSystem : EntitySystem
public sealed class ProjectileSystem : SharedProjectileSystem
{
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
@@ -28,7 +29,7 @@ namespace Content.Server.Projectiles
private void HandleCollide(EntityUid uid, ProjectileComponent component, StartCollideEvent args)
{
// This is so entities that shouldn't get a collision are ignored.
if (!args.OtherFixture.Hard || component.DamagedEntity)
if (args.OurFixture.ID != ProjectileFixture || !args.OtherFixture.Hard || component.DamagedEntity)
{
return;
}
@@ -36,7 +37,7 @@ namespace Content.Server.Projectiles
var otherEntity = args.OtherFixture.Body.Owner;
var coordinates = EntityManager.GetComponent<TransformComponent>(args.OtherFixture.Body.Owner).Coordinates;
var playerFilter = Filter.Pvs(coordinates);
var playerFilter = Filter.Pvs(coordinates, entityMan: EntityManager);
if (!EntityManager.GetComponent<MetaDataComponent>(otherEntity).EntityDeleted && component.SoundHitSpecies != null &&
EntityManager.HasComponent<SharedBodyComponent>(otherEntity))