Skip to content

Commit

Permalink
refactor: explicitly use to_millidegree_celsius
Browse files Browse the repository at this point in the history
discussed in cataclysmbnteam#2570 (comment)

Co-authored-by: Coolthulhu <[email protected]>
  • Loading branch information
scarf005 and Coolthulhu committed Dec 17, 2023
1 parent c3aea32 commit 5be3b16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,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"
Expand Down Expand Up @@ -5757,7 +5758,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;

Expand Down

0 comments on commit 5be3b16

Please sign in to comment.