Drop the aquifer helper and correct the fire burnout comment
Stable Clippy (1.99, what CI runs) does not flag q < -2. || q > 2., so the helper and its test only served Rust 1.90's Clippy. Fire burnout is not 'intentionally disabled': vanilla's FireBlock.tick reads the INCREASED_FIRE_BURNOUT environment attribute, set by eight overworld biomes, which Horizon does not read yet; the comment now says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -77,8 +77,6 @@ pub fn back_off_from_edge<W: EdgeBackoffWorld>(
|
||||
);
|
||||
world.no_collision(bounds).map_err(EdgeBackoffError::World)
|
||||
};
|
||||
// Keep the collision query's short circuit: on-ground movement must not
|
||||
// consume any budget, and an unordered (NaN) fall distance skips it too.
|
||||
let should_back_off = grounded
|
||||
|| (input.fall_distance < step && !can_fall(0.0, 0.0, step - input.fall_distance)?);
|
||||
if !should_back_off {
|
||||
|
||||
@@ -565,7 +565,8 @@ impl<L: LevelAccess + ?Sized> Sim<'_, L> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Nether burnout is intentionally disabled: keep its behavior explicit.
|
||||
// FireBlock.tick reads the INCREASED_FIRE_BURNOUT environment attribute
|
||||
// (jungles, swamps, peaks, mushroom fields); Horizon doesn't yet.
|
||||
let burnout = false;
|
||||
let extra = if burnout { -50 } else { 0 };
|
||||
for (direction, chance) in [
|
||||
|
||||
@@ -447,7 +447,7 @@ impl<P: FluidPicker, F: PositionalRandom, B: AquiferBlockStates> NoiseBasedAquif
|
||||
let n = 3. + edge;
|
||||
if n > 0. { n / 3. } else { n / 10. }
|
||||
};
|
||||
let barrier = if pressure_outside_interval(q) {
|
||||
let barrier = if q < -2. || q > 2. {
|
||||
0.
|
||||
} else {
|
||||
if memo.is_nan() {
|
||||
@@ -603,35 +603,6 @@ impl<P: FluidPicker, F: PositionalRandom, B: AquiferBlockStates> NoiseBasedAquif
|
||||
Ok(Some(candidate))
|
||||
}
|
||||
}
|
||||
/// Preserve ordered floating-point comparisons, including NaN (which lies
|
||||
/// neither below -2 nor above 2). Negating `RangeInclusive::contains` alone
|
||||
/// would incorrectly treat NaN as outside the interval.
|
||||
fn pressure_outside_interval(q: f64) -> bool {
|
||||
!q.is_nan() && !(-2.0..=2.0).contains(&q)
|
||||
}
|
||||
|
||||
fn similarity(a: i32, b: i32) -> f64 {
|
||||
1. - b.wrapping_sub(a) as f64 / 25.
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod pressure_interval_tests {
|
||||
use super::pressure_outside_interval;
|
||||
|
||||
#[test]
|
||||
fn outside_range_preserves_ordered_float_boundary_and_nan_behavior() {
|
||||
for (q, expected) in [
|
||||
(f64::NAN, false),
|
||||
(f64::NEG_INFINITY, true),
|
||||
(-2.1, true),
|
||||
(-2.0, false),
|
||||
(-0.0, false),
|
||||
(0.0, false),
|
||||
(2.0, false),
|
||||
(2.1, true),
|
||||
(f64::INFINITY, true),
|
||||
] {
|
||||
assert_eq!(pressure_outside_interval(q), expected, "q={q:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,8 +70,8 @@ fn zero_budget_only_fails_when_a_probe_is_needed() {
|
||||
|
||||
#[test]
|
||||
fn edge_check_preserves_grounded_and_unordered_fall_distance_short_circuit() {
|
||||
// Neither already-grounded players nor NaN fall distances should query
|
||||
// the world at all. The original `fall_distance < step` is false on NaN.
|
||||
// Neither grounded players nor NaN fall distances query the world:
|
||||
// `fall_distance < step` is false for NaN.
|
||||
let mut world = World {
|
||||
calls: 0,
|
||||
grounded: true,
|
||||
|
||||
Reference in New Issue
Block a user