From 61a568ab53be1623dda9d00b58899397c0835508 Mon Sep 17 00:00:00 2001 From: Isse Date: Thu, 25 Jan 2024 00:40:04 +0100 Subject: [PATCH] weather/tick.rs fixes --- server/src/weather/tick.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/server/src/weather/tick.rs b/server/src/weather/tick.rs index 625f35d24a..acf213ee8a 100644 --- a/server/src/weather/tick.rs +++ b/server/src/weather/tick.rs @@ -140,9 +140,7 @@ impl<'a> System<'a> for Sys { let job = slow_job_pool.spawn("WEATHER", move || { let mut grid = WeatherGrid::new(sim.size()); let lightning_cells = sim.tick(game_time, &mut grid); - weather_tx - .send((grid, lightning_cells, sim)) - .expect("We should never send more than 1 of these.") + let _ = weather_tx.send((grid, lightning_cells, sim)); }); weather_job.state = WeatherJobState::Working(job); @@ -161,9 +159,8 @@ impl<'a> System<'a> for Sys { "This is non-empty, since we multiply with its len for the chance to do a \ lightning strike.", ); - let wpos = cell_pos.map(|e| { - (e as f32 + thread_rng().gen_range(0.0..1.0)) * common::weather::CELL_SIZE as f32 - }); + let wpos = cell_pos + .map(|e| (e as f32 + rng.gen_range(0.0..1.0)) * common::weather::CELL_SIZE as f32); outcome_emitter.emit(Outcome::Lightning { pos: wpos.with_z(world.sim().get_alt_approx(wpos.as_()).unwrap_or(0.0)), });