Skip to content

Commit

Permalink
Joined declaration and assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg committed Dec 3, 2019
1 parent fadcffd commit f74f481
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7044,9 +7044,8 @@ std::vector<Creature *> player::get_targetable_creatures( const int range ) cons
std::vector<Creature *> player::get_hostile_creatures( int range ) const
{
return g->get_creatures_if( [this, range]( const Creature & critter ) -> bool {
float dist_to_creature;
// Fixes circular distance range for ranged attacks
dist_to_creature = round( rl_dist_exact( pos(), critter.pos() ) );
float dist_to_creature = round( rl_dist_exact( pos(), critter.pos() ) );
return this != &critter && pos() != critter.pos() && // TODO: get rid of fake npcs (pos() check)
dist_to_creature <= range && critter.attitude_to( *this ) == A_HOSTILE
&& sees( critter );
Expand Down

0 comments on commit f74f481

Please sign in to comment.