Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fields are not spreading north-west when they shouldn't anymore #34226

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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