Fix Assumption of Nullable to have value (#41220)

* Fix Potential Test Fail

* Please the maintainer gods
This commit is contained in:
Sir Warock
2025-10-31 18:17:58 +01:00
committed by GitHub
parent ed47827d56
commit 79035cd023
3 changed files with 8 additions and 8 deletions

View File

@@ -90,11 +90,11 @@ public abstract partial class SharedProjectileSystem : EntitySystem
EmbedAttach(embeddable, args.Target, args.Shooter, embeddable.Comp);
// Raise a specific event for projectiles.
if (TryComp(embeddable, out ProjectileComponent? projectile))
{
var ev = new ProjectileEmbedEvent(projectile.Shooter!.Value, projectile.Weapon!.Value, args.Target);
RaiseLocalEvent(embeddable, ref ev);
}
if (!TryComp<ProjectileComponent>(embeddable, out var projectile))
return;
var ev = new ProjectileEmbedEvent(projectile.Shooter, projectile.Weapon, args.Target);
RaiseLocalEvent(embeddable, ref ev);
}
private void EmbedAttach(EntityUid uid, EntityUid target, EntityUid? user, EmbeddableProjectileComponent component)