Skip to content

Commit

Permalink
vision transparency cache update doesn't trigger seen cache rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
SurFlurer committed Oct 17, 2024
1 parent 2e5b3cf commit a4f3979
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/lightmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ bool map::build_vision_transparency_cache( const int zlev )
return false;
}

bool dirty = false;

// This segment handles vision when the player is crouching or prone. It only checks adjacent tiles.
// If you change this, also consider creature::sees and map::obstacle_coverage.
bool is_crouching = player_character.is_crouching();
Expand All @@ -226,7 +224,6 @@ bool map::build_vision_transparency_cache( const int zlev )
previous_move_mode != player_character.current_movement_mode() ) {
previous_move_mode = player_character.current_movement_mode();
vision_transparency_cache[loc.x()][loc.y()] = LIGHT_TRANSPARENCY_SOLID;
dirty = true;
}
}
}
Expand All @@ -238,11 +235,10 @@ bool map::build_vision_transparency_cache( const int zlev )
vision_transparency_cache[p.x()][p.y()] = LIGHT_TRANSPARENCY_OPEN_AIR;
} else if( map::ter( loc ).obj().has_flag( ter_furn_flag::TFLAG_TRANSLUCENT ) ) {
vision_transparency_cache[loc.x()][loc.y()] = LIGHT_TRANSPARENCY_SOLID;
dirty = true;
}
}

return dirty;
return false;
}

void map::apply_character_light( Character &p )
Expand Down
2 changes: 1 addition & 1 deletion src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10077,7 +10077,7 @@ void map::build_map_cache( const int zlev, bool skip_lightmap )
do_vehicle_caching( z );
}
for( int z = minz; z <= maxz; z++ ) {
seen_cache_dirty |= build_vision_transparency_cache( z );
build_vision_transparency_cache( z );
}

if( seen_cache_dirty ) {
Expand Down

0 comments on commit a4f3979

Please sign in to comment.