Skip to content

Commit

Permalink
Apply scent blocking for fake parts
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade committed Apr 27, 2022
1 parent 1c07097 commit 2deda68
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8742,19 +8742,11 @@ void map::scent_blockers( std::array<std::array<bool, MAPSIZE_X>, MAPSIZE_Y> &bl
auto vehs = get_vehicles();
for( auto &wrapped_veh : vehs ) {
vehicle &veh = *( wrapped_veh.v );
for( const vpart_reference &vp : veh.get_any_parts( VPFLAG_OBSTACLE ) ) {
const tripoint part_pos = vp.pos();
if( local_bounds.contains( part_pos.xy() ) ) {
reduces_scent[part_pos.x][part_pos.y] = true;
}
}

// Doors, but only the closed ones
for( const vpart_reference &vp : veh.get_any_parts( VPFLAG_OPENABLE ) ) {
if( vp.part().open ) {
for( const vpart_reference &vp : veh.get_all_parts_with_fakes() ) {
if( !vp.has_feature( VPFLAG_OBSTACLE ) &&
( !vp.has_feature( VPFLAG_OPENABLE ) || !vp.part().open ) ) {
continue;
}

const tripoint part_pos = vp.pos();
if( local_bounds.contains( part_pos.xy() ) ) {
reduces_scent[part_pos.x][part_pos.y] = true;
Expand Down

0 comments on commit 2deda68

Please sign in to comment.