mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
weather/tick.rs fixes
This commit is contained in:
parent
ef59e57347
commit
61a568ab53
@ -140,9 +140,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
let job = slow_job_pool.spawn("WEATHER", move || {
|
let job = slow_job_pool.spawn("WEATHER", move || {
|
||||||
let mut grid = WeatherGrid::new(sim.size());
|
let mut grid = WeatherGrid::new(sim.size());
|
||||||
let lightning_cells = sim.tick(game_time, &mut grid);
|
let lightning_cells = sim.tick(game_time, &mut grid);
|
||||||
weather_tx
|
let _ = weather_tx.send((grid, lightning_cells, sim));
|
||||||
.send((grid, lightning_cells, sim))
|
|
||||||
.expect("We should never send more than 1 of these.")
|
|
||||||
});
|
});
|
||||||
|
|
||||||
weather_job.state = WeatherJobState::Working(job);
|
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 \
|
"This is non-empty, since we multiply with its len for the chance to do a \
|
||||||
lightning strike.",
|
lightning strike.",
|
||||||
);
|
);
|
||||||
let wpos = cell_pos.map(|e| {
|
let wpos = cell_pos
|
||||||
(e as f32 + thread_rng().gen_range(0.0..1.0)) * common::weather::CELL_SIZE as f32
|
.map(|e| (e as f32 + rng.gen_range(0.0..1.0)) * common::weather::CELL_SIZE as f32);
|
||||||
});
|
|
||||||
outcome_emitter.emit(Outcome::Lightning {
|
outcome_emitter.emit(Outcome::Lightning {
|
||||||
pos: wpos.with_z(world.sim().get_alt_approx(wpos.as_()).unwrap_or(0.0)),
|
pos: wpos.with_z(world.sim().get_alt_approx(wpos.as_()).unwrap_or(0.0)),
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user