From 6dbe96751c03e946a98bfa20b0a52ae3980c4d06 Mon Sep 17 00:00:00 2001 From: Hirmuolio <22011552+Hirmuolio@users.noreply.github.com> Date: Sat, 27 Aug 2022 06:37:24 +0300 Subject: [PATCH] passive solar panel (#60445) --- src/bionics.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bionics.cpp b/src/bionics.cpp index 818200e893eba..b62a447fe8c98 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -1568,8 +1568,9 @@ void Character::passive_power_gen( const bionic &bio ) } if( fuel == fuel_type_sun_light ) { - const double modifier = g->natural_light_level( pos().z ) / default_daylight_level(); - mod_power_level( units::from_kilojoule( fuel_energy ) * modifier * effective_passive_efficiency ); + const float intensity = incident_sun_irradiance( current_weather( pos() ), + calendar::turn ) / max_sun_irradiance(); + mod_power_level( units::from_kilojoule( fuel_energy ) * intensity * effective_passive_efficiency ); } else if( fuel == fuel_type_wind ) { int vehwindspeed = 0; const optional_vpart_position vp = here.veh_at( pos() );