From e42a82e9b99335f58aae3011f153db96ee908f3e Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 07:03:08 +0100 Subject: [PATCH] Name the difficulty id field as #2239 does #2239 adds the same LocalDifficulty field as `id`; with the same lines here the two branches merge without a conflict. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/mobs/bee.rs | 2 +- crates/horizon-client/src/mobs/spawning.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/horizon-client/src/mobs/bee.rs b/crates/horizon-client/src/mobs/bee.rs index 741a78df6..92c11544c 100644 --- a/crates/horizon-client/src/mobs/bee.rs +++ b/crates/horizon-client/src/mobs/bee.rs @@ -324,7 +324,7 @@ pub fn sting(m: &mut Mob, who: Who, cx: &mut Cx) { Who::Player => { cx.events.push(MobEvent::AttackPlayer(amount, from)); // Poison only on normal (10 s) and hard (18 s). - let seconds = match cx.w.difficulty.base { + let seconds = match cx.w.difficulty.id { 2 => 10, 3 => 18, _ => 0, diff --git a/crates/horizon-client/src/mobs/spawning.rs b/crates/horizon-client/src/mobs/spawning.rs index 57ecb1692..bbb8e2e46 100644 --- a/crates/horizon-client/src/mobs/spawning.rs +++ b/crates/horizon-client/src/mobs/spawning.rs @@ -37,8 +37,8 @@ pub struct LocalDifficulty { pub effective: f32, /// The world difficulty is hard. pub hard: bool, - /// The world difficulty id, 0 peaceful to 3 hard. - pub base: u8, + /// `Difficulty.getId`: 0 peaceful to 3 hard. + pub id: u8, } /// `DimensionType.MOON_BRIGHTNESS_PER_PHASE`. pub const MOON_BRIGHTNESS: [f32; 8] = [1.0, 0.75, 0.5, 0.25, 0.0, 0.25, 0.5, 0.75]; @@ -51,7 +51,7 @@ impl LocalDifficulty { return Self { effective: 0.0, hard, - base, + id: base, }; } let global = ((total as f32 - 72000.0) / 1_440_000.0).clamp(0.0, 1.0) * 0.25; @@ -64,7 +64,7 @@ impl LocalDifficulty { Self { effective: f32::from(base) * (0.75 + global + local), hard, - base, + id: base, } } /// `getSpecialMultiplier`.