fix grappling hooks getting bricked (#32738)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2024-10-16 22:32:32 +00:00
committed by GitHub
parent 8aac87a2fe
commit cc17acbda8

View File

@@ -114,19 +114,14 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
private void OnGunActivate(EntityUid uid, GrapplingGunComponent component, ActivateInWorldEvent args)
{
if (!Timing.IsFirstTimePredicted || args.Handled || !args.Complex)
return;
if (Deleted(component.Projectile))
if (!Timing.IsFirstTimePredicted || args.Handled || !args.Complex || component.Projectile is not {} projectile)
return;
_audio.PlayPredicted(component.CycleSound, uid, args.User);
_appearance.SetData(uid, SharedTetherGunSystem.TetherVisualsStatus.Key, true);
if (_netManager.IsServer)
{
QueueDel(component.Projectile.Value);
}
QueueDel(projectile);
component.Projectile = null;
SetReeling(uid, component, false, args.User);