Update SharedProjectileSystem.cs

This commit is contained in:
Ed
2025-01-24 23:18:26 +03:00
parent 2ee1716a85
commit 2de94ea8b2

View File

@@ -104,9 +104,9 @@ public abstract partial class SharedProjectileSystem : EntitySystem
Embed(uid, args.Target, args.Shooter, component);
// Raise a specific event for projectiles.
if (TryComp(uid, out ProjectileComponent? projectile))
if (TryComp(uid, out ProjectileComponent? projectile) && projectile.Shooter is not null && projectile.Weapon is not null) //CP14 safier
{
var ev = new ProjectileEmbedEvent(projectile.Shooter!.Value, projectile.Weapon!.Value, args.Target);
var ev = new ProjectileEmbedEvent(projectile.Shooter.Value, projectile.Weapon.Value, args.Target); //CP14 safier
RaiseLocalEvent(uid, ref ev);
}
}