Skip to content

Commit

Permalink
Fix duplicates in item view (#1994)
Browse files Browse the repository at this point in the history
* Fixes duplicates in item view

* Don't skip the lowest z level
  • Loading branch information
joveeater authored Oct 15, 2022
1 parent 988b8c9 commit 3b88e28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7011,10 +7011,10 @@ std::vector<map_item_stack> game::find_nearby_items( int iRadius )
return ret;
}

int range = fov_3d ? fov_3d_z_range : 0;
int range = fov_3d ? ( fov_3d_z_range * 2 ) + 1 : 1;
int center_z = u.pos().z;

for( int i = 0; i <= range * 2; i++ ) {
for( int i = 1; i <= range; i++ ) {
int z = i % 2 ? center_z - i / 2 : center_z + i / 2;
for( auto &points_p_it : closest_points_first( {u.pos().xy(), z}, iRadius ) ) {
if( points_p_it.y >= u.posy() - iRadius && points_p_it.y <= u.posy() + iRadius &&
Expand Down

0 comments on commit 3b88e28

Please sign in to comment.