From ecabd31c9ac02a842dd5d25386539ed389853241 Mon Sep 17 00:00:00 2001 From: scarf Date: Fri, 7 Apr 2023 00:09:06 +0900 Subject: [PATCH] refactor: explicitly use `to_millidegree_celsius` discussed in https://github.com/cataclysmbnteam/Cataclysm-BN/pull/2570#discussion_r1158753275 Co-authored-by: Coolthulhu --- src/character.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/character.cpp b/src/character.cpp index ab314e21aa70..2bb3f0f9a18e 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -91,6 +91,7 @@ #include "trap.h" #include "ui.h" #include "ui_manager.h" +#include "units_temperature.h" #include "units_utility.h" #include "value_ptr.h" #include "veh_interact.h" @@ -5221,7 +5222,7 @@ void Character::update_bodytemp( const map &m, const weather_manager &weather ) const int lying_warmth = use_floor_warmth ? floor_warmth( pos() ) : 0; const int water_temperature_raw = - 100 * weather.get_water_temperature( pos() ).value(); + units::to_millidegree_celsius( weather.get_water_temperature( pos() ) ) / 10; // Rescale so that 0C is 0 (FREEZING) and 30C is 5k (NORM). const int water_temperature = water_temperature_raw * 5 / 3;