]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix cryopod debug assert (#24830)
authorthemias <89101928+themias@users.noreply.github.com>
Thu, 1 Feb 2024 22:33:53 +0000 (17:33 -0500)
committerGitHub <noreply@github.com>
Thu, 1 Feb 2024 22:33:53 +0000 (09:33 +1100)
Content.Server/Medical/CryoPodSystem.cs

index e05dc2494fb6d9f627a825c4d5e3e45c33cf394f..2f08dfddd171c0220a65aa88bba4603b7dd1f088 100644 (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
         ));