Skip to content

Commit

Permalink
Merge pull request #36687 from anothersimulacrum/vis
Browse files Browse the repository at this point in the history
Prevent high eye encumbrance from blinding players
  • Loading branch information
ZhilkinSerg committed Jan 4, 2020
2 parents d0a3632 + 5c02744 commit 537fd02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,9 @@ float Character::get_vision_threshold( float light_level ) const
range++;
}

// Clamp range to 1+, so that we can always see where we are
range = std::max( 1.0f, range );

return std::min( static_cast<float>( LIGHT_AMBIENT_LOW ),
threshold_for_range( range ) * dimming_from_light );
}
Expand Down

0 comments on commit 537fd02

Please sign in to comment.