Fix cryopod debug assert (#24830)

This commit is contained in:
themias
2024-02-01 17:33:53 -05:00
committed by GitHub
parent c49c78bafa
commit efb623de19

View File

@@ -181,6 +181,9 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem
private void OnActivateUI(Entity<CryoPodComponent> entity, ref AfterActivatableUIOpenEvent args)
{
if (!entity.Comp.BodyContainer.ContainedEntity.HasValue)
return;
TryComp<TemperatureComponent>(entity.Comp.BodyContainer.ContainedEntity, out var temp);
TryComp<BloodstreamComponent>(entity.Comp.BodyContainer.ContainedEntity, out var bloodstream);
@@ -189,7 +192,8 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem
HealthAnalyzerUiKey.Key,
new HealthAnalyzerScannedUserMessage(GetNetEntity(entity.Comp.BodyContainer.ContainedEntity),
temp?.CurrentTemperature ?? 0,
(bloodstream != null && _solutionContainerSystem.ResolveSolution(entity.Owner, bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution))
(bloodstream != null && _solutionContainerSystem.ResolveSolution(entity.Comp.BodyContainer.ContainedEntity.Value,
bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution))
? bloodSolution.FillFraction
: 0
));