From 992576509a67ba18e51fe60189bc54e442ab8cd7 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Thu, 30 Dec 2021 16:28:52 +0100 Subject: [PATCH] Fix bad analysis with nullables in Rider. --- Content.Shared/Chemistry/Components/Solution.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Content.Shared/Chemistry/Components/Solution.cs b/Content.Shared/Chemistry/Components/Solution.cs index 3911ce094f..e1b02ee62a 100644 --- a/Content.Shared/Chemistry/Components/Solution.cs +++ b/Content.Shared/Chemistry/Components/Solution.cs @@ -108,11 +108,9 @@ namespace Content.Shared.Chemistry.Components if (!IoCManager.Resolve().TryIndex(reagentId, out ReagentPrototype? proto)) proto = new ReagentPrototype(); - if (temperature == null) - temperature = Temperature; - + var actualTemp = temperature ?? Temperature; var oldThermalEnergy = Temperature * GetHeatCapacity(); - var addedThermalEnergy = (float) ((float) quantity * proto.SpecificHeat * temperature); + var addedThermalEnergy = (float) quantity * proto.SpecificHeat * actualTemp; for (var i = 0; i < Contents.Count; i++) { var reagent = Contents[i];