Skip to content

Commit

Permalink
Fields are not spreading north-west when they shouldn't anymore (#34226)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg authored and kevingranade committed Sep 26, 2019
1 parent bccceff commit a8afea2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/map_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ void map::spread_gas( field_entry &cur, const tripoint &p, int percent_spread,
// Then, spread to a nearby point.
// If not possible (or randomly), try to spread up
// Wind direction will block the field spreading into the wind.
spread.reserve( 8 );
// Start at end_it + 1, then wrap around until all elements have been processed.
for( size_t i = ( end_it + 1 ) % neighs.size(), count = 0 ;
count != neighs.size();
Expand All @@ -297,7 +296,7 @@ void map::spread_gas( field_entry &cur, const tripoint &p, int percent_spread,
const maptile remove_tile = std::get<0>( maptiles );
const maptile remove_tile2 = std::get<1>( maptiles );
const maptile remove_tile3 = std::get<2>( maptiles );
if( !zlevels || one_in( spread.size() ) ) {
if( !spread.empty() && ( !zlevels || one_in( spread.size() ) ) ) {
// Construct the destination from offset and p
if( g->is_sheltered( p ) || windpower < 5 ) {
gas_spread_to( cur, neighs[ random_entry( spread ) ] );
Expand Down

0 comments on commit a8afea2

Please sign in to comment.