diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-14 08:30:58 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-14 08:30:58 +0300 |
| commit | acc5af7cc79a5ee2132c5d10528ca1cf06186832 (patch) | |
| tree | 8be00a773fec66584acb94be963d6c3e05e7c0aa /crates/fparkan-runtime/src/autodemo.rs | |
| parent | 6c8d9b2dce43a0e8b559785f73a7631935f11132 (diff) | |
| download | fparkan-acc5af7cc79a5ee2132c5d10528ca1cf06186832.tar.xz fparkan-acc5af7cc79a5ee2132c5d10528ca1cf06186832.zip | |
feat(runtime): route AutoDemo patrols through terrain areas
Diffstat (limited to 'crates/fparkan-runtime/src/autodemo.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/autodemo.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/fparkan-runtime/src/autodemo.rs b/crates/fparkan-runtime/src/autodemo.rs index a31a8c7b..5ac401fd 100644 --- a/crates/fparkan-runtime/src/autodemo.rs +++ b/crates/fparkan-runtime/src/autodemo.rs @@ -13,7 +13,7 @@ const PITCH: f32 = 1.25; const YAW: f32 = std::f32::consts::FRAC_PI_2; const FOLLOW_DISTANCE: f32 = 30.0; const PLANT_CLASS: u32 = 0x8000_0010; -const MOBILE_UNIT: u32 = 0x0100_0000; +pub(super) const MOBILE_UNIT: u32 = 0x0100_0000; pub(super) fn read_config( vfs: &Arc<dyn Vfs>, @@ -156,8 +156,7 @@ pub(super) fn reinforcement_position( let scale = plant.scale.into_iter().map(f32::abs).fold(0.0, f32::max); let radius = bounds.bounding_sphere_radius * scale; // shortcut: isolated CRT state until AutoDemo shares the host's complete RNG call order. - *rng = rng.wrapping_mul(0x343fd).wrapping_add(0x269ec3); - let angle = (((*rng >> 16) & 0x7fff) % 360) as f32; + let angle = (super::next_crt_rand(rng) % 360) as f32; let (sin, cos) = angle.to_radians().sin_cos(); let [x, y] = [x + sin * radius, y + cos * radius]; let z = terrain |
