Skip to content

Commit

Permalink
Merge branch 'Putnam3145:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ike709 authored Jul 23, 2021
2 parents 0772718 + 93f5678 commit a44eb01
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 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
12 changes: 10 additions & 2 deletions src/turfs/processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,11 @@ fn post_process() {
let _ = sender.try_send(Box::new(move || {
for &i in &copy {
let turf = unsafe { Value::turf_by_id_unchecked(i) };
turf.get(byond_string!("air"))?.call("react", &[&turf])?;
if cfg!(target_os="linux") {
turf.get(byond_string!("air"))?.call("vv_react", &[&turf])?;
} else {
turf.get(byond_string!("air"))?.call("react", &[&turf])?;
}
}
Ok(Value::null())
}));
Expand All @@ -688,7 +692,11 @@ fn post_process() {
let _ = sender.try_send(Box::new(move || {
for &i in &reacters {
let turf = unsafe { Value::turf_by_id_unchecked(i) };
turf.get(byond_string!("air"))?.call("react", &[&turf])?;
if cfg!(target_os="linux") {
turf.get(byond_string!("air"))?.call("vv_react", &[&turf])?;
} else {
turf.get(byond_string!("air"))?.call("react", &[&turf])?;
}
}
for &i in &visual_updaters {
let turf = unsafe { Value::turf_by_id_unchecked(i) };
Expand Down

0 comments on commit a44eb01

Please sign in to comment.