Skip to content

Commit

Permalink
Moved some redundant stuff around
Browse files Browse the repository at this point in the history
  • Loading branch information
Putnam3145 committed Jul 20, 2021
1 parent e142546 commit d4a8c49
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/turfs/monstermos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,14 @@ fn flood_fill_equalize_turfs(
let sender = byond_callback_sender();
let mut total_moles = 0.0_f64;
border_turfs.push_back((i, m));
found_turfs.insert(i);
#[allow(unused_mut)]
let mut space_this_time = false;
loop {
if turfs.len() > equalize_hard_turf_limit {
break;
}
if let Some((cur_idx, cur_turf)) = border_turfs.pop_front() {
found_turfs.insert(cur_idx);
if turfs.len() < equalize_turf_limit {
if cur_turf.planetary_atmos.is_some() {
planet_turfs.push((cur_idx, cur_turf));
Expand Down Expand Up @@ -446,11 +446,11 @@ fn give_to_takers(
}
let (idx, turf) = *queue.get(queue_idx).unwrap();
for (j, loc) in adjacent_tile_ids(turf.adjacency, idx, max_x, max_y) {
if giver_info.mole_delta <= 0.0 {
break;
}
if let Some(adj_orig) = info.get(&loc) {
if let Some(adj_mix) = turf_gases().get(&loc) {
if giver_info.mole_delta <= 0.0 {
break;
}
let mut adj_info = adj_orig.get();
if adj_info.last_slow_queue_cycle != *queue_cycle_slow {
queue.push((loc, *adj_mix.value()));
Expand Down Expand Up @@ -524,12 +524,12 @@ fn take_from_givers(
}
let (idx, turf) = *queue.get(queue_idx).unwrap();
for (j, loc) in adjacent_tile_ids(turf.adjacency, idx, max_x, max_y) {
if taker_info.mole_delta >= 0.0 {
break;
}
if let Some(adj_orig) = info.get(&loc) {
if let Some(adj_mix) = turf_gases().get(&loc) {
let mut adj_info = adj_orig.get();
if taker_info.mole_delta >= 0.0 {
break;
}
if adj_info.last_slow_queue_cycle != *queue_cycle_slow {
queue.push((loc, *adj_mix));
adj_info.last_slow_queue_cycle = *queue_cycle_slow;
Expand Down

0 comments on commit d4a8c49

Please sign in to comment.