Skip to content

Commit

Permalink
Merge pull request CleverRaven#17141 from Coolthulhu/zed-nv-buff
Browse files Browse the repository at this point in the history
Fix night vision range bug
  • Loading branch information
Rivet-the-Zombie authored Jun 11, 2016
2 parents a07875b + 8007d2d commit da8e19c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,14 @@ bool Creature::sees( const tripoint &t, bool is_player ) const
return false;
}

const int range_cur = sight_range( g->m.ambient_light_at(t) );
const int range_cur = sight_range( g->m.ambient_light_at( t ) );
const int range_day = sight_range( DAYLIGHT_LEVEL );
const int range_min = std::min( range_cur, range_day );
const int range_night = sight_range( 0 );
const int range_max = std::max( range_day, range_night );
const int range_min = std::min( range_cur, range_max );
const int wanted_range = rl_dist( pos(), t );
if( wanted_range <= range_min ||
( wanted_range <= range_day &&
( wanted_range <= range_max &&
g->m.ambient_light_at( t ) > g->natural_light_level( t.z ) ) ) {
int range = 0;
if( g->m.ambient_light_at( t ) > g->natural_light_level( t.z ) ) {
Expand Down

0 comments on commit da8e19c

Please sign in to comment.