Fix AudioSystem nullability checks for engine PR (#32233)

This commit is contained in:
Leon Friedrich
2024-09-18 11:43:30 +10:00
committed by Spatison
parent de98315595
commit 302baba768
10 changed files with 17 additions and 41 deletions

View File

@@ -325,14 +325,8 @@ namespace Content.Server.Kitchen.EntitySystems
active.EndTime = _timing.CurTime + reagentGrinder.WorkTime * reagentGrinder.WorkTimeMultiplier;
active.Program = program;
// slightly higher pitched
var audio = _audioSystem.PlayPvs(sound, uid,
AudioParams.Default.WithPitchScale(1 / reagentGrinder.WorkTimeMultiplier));
if (audio == null)
return;
reagentGrinder.AudioStream = audio!.Value.Entity;
reagentGrinder.AudioStream = _audioSystem.PlayPvs(sound, uid,
AudioParams.Default.WithPitchScale(1 / reagentGrinder.WorkTimeMultiplier))?.Entity; //slightly higher pitched
_userInterfaceSystem.ServerSendUiMessage(uid, ReagentGrinderUiKey.Key,
new ReagentGrinderWorkStartedMessage(program));
}