Skip to content

Commit

Permalink
Merge pull request #72684 from nornagon/no-regenerate-in-sunlight
Browse files Browse the repository at this point in the history
no regenerates_in_dark in sunlight
  • Loading branch information
nornagon authored and Procyonae committed May 24, 2024
1 parent ae6d2b2 commit 120fde4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3167,7 +3167,7 @@ void monster::process_effects()
add_msg_if_player_sees( *this, m_warning, healing_format_string, name() );
}

if( type->regenerates_in_dark ) {
if( type->regenerates_in_dark && !g->is_in_sunlight( pos() ) ) {
const float light = get_map().ambient_light_at( pos() );
// Magic number 10000 was chosen so that a floodlight prevents regeneration in a range of 20 tiles
const float dHP = 50.0 * std::exp( - light * light / 10000 );
Expand Down

0 comments on commit 120fde4

Please sign in to comment.