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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user