Skip to content

Commit

Permalink
Stop ant tunnels stomping over other map terrain underground and remo…
Browse files Browse the repository at this point in the history
…ving staircases (#36702)

* stop ant tunnels stomping over other map terrain underground
* also add check to adjacent loop
  • Loading branch information
davidpwbrown authored and kevingranade committed Jan 5, 2020
1 parent fdcae19 commit ada2433
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/overmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3218,14 +3218,18 @@ void overmap::build_tunnel( const tripoint &p, int s, om_direction::type dir )
if( check_ot( "ants", ot_match_type::type, p ) && root_id != ter( p )->id ) {
return;
}
if( !is_ot_match( "empty_rock", ter( p )->id, ot_match_type::type ) ) {
return;
}

ter_set( p, oter_id( root_id ) );

std::vector<om_direction::type> valid;
valid.reserve( om_direction::size );
for( auto r : om_direction::all ) {
const tripoint cand = p + om_direction::displace( r );
if( !check_ot( "ants", ot_match_type::type, cand ) ) {
if( !check_ot( "ants", ot_match_type::type, cand ) &&
!is_ot_match( "empty_rock", ter( cand )->id, ot_match_type::type ) ) {
valid.push_back( r );
}
}
Expand Down

0 comments on commit ada2433

Please sign in to comment.