Skip to content

Commit

Permalink
Don't access out of bounds (#73653)
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA authored May 11, 2024
1 parent e84f3c1 commit aee9514
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4138,6 +4138,9 @@ bool cata_tiles::draw_critter_above( const tripoint &p, lit_level ll, int &heigh
// Search for a creature above
while( pcritter == nullptr && !here.dont_draw_lower_floor( scan_p ) &&
scan_p.z - you.pos().z <= fov_3d_z_range ) {
if( scan_p.z > OVERMAP_HEIGHT ) {
break;
}
pcritter = get_creature_tracker().creature_at( scan_p, true );
scan_p.z++;
}
Expand Down

0 comments on commit aee9514

Please sign in to comment.