diff --git a/src/map.cpp b/src/map.cpp index e00e27ec4773f..4f2e0db70f566 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -8381,7 +8381,8 @@ void map::handle_decayed_corpse( const item &it, const tripoint_abs_ms &pnt ) anything_left = roll > 0; for( int i = 0; i < roll; i++ ) { if( harvest.has_temperature() ) { - harvest.set_item_temperature( get_weather().get_temperature( project_to( pnt ) ) ); + harvest.set_item_temperature( get_weather().get_area_temperature( project_to + ( pnt ) ) ); } add_item_or_charges( get_bub( pnt ), harvest, false ); if( anything_left && notify_player ) { diff --git a/src/weather.cpp b/src/weather.cpp index f659ea17bbf67..28234b055d541 100644 --- a/src/weather.cpp +++ b/src/weather.cpp @@ -883,7 +883,7 @@ bool warm_enough_to_plant( const tripoint_abs_omt &pos, const itype_id &it ) std::map planting_times; // initialize the first... time_point check_date = calendar::turn; - planting_times[check_date] = get_weather().get_temperature( pos ); + planting_times[check_date] = get_weather().get_area_temperature( pos ); bool okay_to_plant = true; const int num_epochs = 3; // FIXME. Should be stored on the seed ptr and read from there! // and now iterate a copy of the weather into the future to see if they'll be plantable then as well. @@ -1011,7 +1011,7 @@ units::temperature weather_manager::get_temperature( const tripoint_bub_ms &loca return temp; } -units::temperature weather_manager::get_temperature( const tripoint_abs_omt &location ) const +units::temperature weather_manager::get_area_temperature( const tripoint_abs_omt &location ) const { return location.z() < 0 ? units::from_celsius( get_weather().get_cur_weather_gen().base_temperature ) : temperature; diff --git a/src/weather.h b/src/weather.h index daf4afd54f631..6f4baf14ea22f 100644 --- a/src/weather.h +++ b/src/weather.h @@ -220,10 +220,16 @@ class weather_manager time_point nextweather; /** temperature cache, cleared every turn, sparse map of map tripoints to temperatures */ std::unordered_map< tripoint_bub_ms, units::temperature > temperature_cache; - // Returns outdoor or indoor temperature of given location + /* + * Returns current temperature of given tile. Includes temperature modifications from + * radiative and convective sources, such as fires or hot air from heaters. + */ units::temperature get_temperature( const tripoint_bub_ms &location ); - // Returns outdoor or indoor temperature of given location - units::temperature get_temperature( const tripoint_abs_omt &location ) const; + /* + * Returns temperature of given OMT. Does not include any modifications from local sourecs, + * this is essentially the "natural" temperature. + */ + units::temperature get_area_temperature( const tripoint_abs_omt &location ) const; void clear_temp_cache(); static void serialize_all( JsonOut &json ); static void unserialize_all( const JsonObject &w );