From 839ea6d04c877fc36f6392334c63e6219cffb59c Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Mon, 12 Oct 2026 17:13:57 +0200 Subject: [PATCH] Give the level random back to the level after the mobs' ticks Brain behaviours draw from the level random (DoNothing, POI scans): the game lends it to the mobs and keeps what they drew. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game/creatures.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/horizon-client/src/game/creatures.rs b/crates/horizon-client/src/game/creatures.rs index 73485c876..e52adc066 100644 --- a/crates/horizon-client/src/game/creatures.rs +++ b/crates/horizon-client/src/game/creatures.rs @@ -460,8 +460,11 @@ impl Game<'_> { let mut mobs = std::mem::take(&mut self.mobs); let mut dead = Vec::new(); let mut died = std::mem::take(&mut self.died); + let level_random; { let w = self.mob_world_base(&snapshot); + // The level random, lent to the mobs (brain behaviours draw from + // it) and taken back after their ticks. let mut scratch = self.world.random.clone(); mobs.retain_mut(|m| { if !w @@ -481,7 +484,9 @@ impl Game<'_> { keep }); push_apart(&mut mobs); + level_random = scratch; } + self.world.random = level_random; self.mobs.append(&mut mobs); self.died = died; self.sync_riders();