Allow sound to play at the start of anomaly supercritical animation (#36260)

* Add datafield to AnomalyComponent to play a sound when an anomaly enters supercriticality

* use Entity<T> pattern

* use implicit default for nullable

* don't forget to resolve the AnomalyComponent...

* Add comment for StartSupercriticalEvent "ent" parameter

* use implicit casts from Entity<T> to EntityUid

* StartSupercriticalEvent requires AnomalyComponent to resolve
This commit is contained in:
Quantum-cross
2025-04-08 05:11:32 -04:00
committed by GitHub
parent 5cc8b01e64
commit 716c0ef51f
3 changed files with 23 additions and 12 deletions

View File

@@ -44,10 +44,10 @@ public sealed partial class AnomalySystem
if (!NetEntity.TryParse(args[0], out var uidNet) || !TryGetEntity(uidNet, out var uid))
return;
if (!HasComp<AnomalyComponent>(uid))
if (!TryComp<AnomalyComponent>(uid, out var anomaly))
return;
StartSupercriticalEvent(uid.Value);
StartSupercriticalEvent((uid.Value, anomaly));
}
private CompletionResult GetAnomalyCompletion(IConsoleShell shell, string[] args)