diff --git a/crates/horizon-world/src/edge_backoff.rs b/crates/horizon-world/src/edge_backoff.rs index 0dfebdae2..4303b2d74 100644 --- a/crates/horizon-world/src/edge_backoff.rs +++ b/crates/horizon-world/src/edge_backoff.rs @@ -77,8 +77,6 @@ pub fn back_off_from_edge( ); 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 { diff --git a/crates/horizon-world/src/level/tick.rs b/crates/horizon-world/src/level/tick.rs index bced59df9..29f53e053 100644 --- a/crates/horizon-world/src/level/tick.rs +++ b/crates/horizon-world/src/level/tick.rs @@ -565,7 +565,8 @@ impl 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 [ diff --git a/crates/horizon-world/src/worldgen/aquifer/noise_based.rs b/crates/horizon-world/src/worldgen/aquifer/noise_based.rs index 60abbc371..3f3c7dc2c 100644 --- a/crates/horizon-world/src/worldgen/aquifer/noise_based.rs +++ b/crates/horizon-world/src/worldgen/aquifer/noise_based.rs @@ -447,7 +447,7 @@ impl 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 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:?}"); - } - } -} diff --git a/crates/horizon-world/tests/edge_backoff.rs b/crates/horizon-world/tests/edge_backoff.rs index e8f37057f..4e6999205 100644 --- a/crates/horizon-world/tests/edge_backoff.rs +++ b/crates/horizon-world/tests/edge_backoff.rs @@ -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,