Skip to content

Commit

Permalink
Fixed out of bounds transparency cache access (#72850)
Browse files Browse the repository at this point in the history
The problem is caused by points_in_radius() producing negative coordinates.

Used #72747 (comment)

Fixes #70229
Fixes #72652
  • Loading branch information
l29ah authored Apr 9, 2024
1 parent f78bf49 commit 22e5420
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/map_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,9 @@ static void field_processor_fd_electricity( const tripoint &p, field_entry &cur,

bool valid_candidates = false;
for( const tripoint &dst : points_in_radius( p, 1 ) ) {
if( !pd.here.inbounds( dst ) ) {
continue;
}
// Skip tiles with intense fields
const field_type_str_id &field_type = pd.here.get_applicable_electricity_field( dst );
if( field_entry *field = pd.here.get_field( dst, field_type ) ) {
Expand Down

0 comments on commit 22e5420

Please sign in to comment.