Files
benilla-octo/crates
Sam SungandClaude Opus 5.5 655854c154 The zoom limit is cameraDistanceMax × cameraDistanceMaxFactor held to [0, 50] by the reference's ordered compares, cameraDistanceMax a registered CVar, and a NaN factor zooms without panicking (#475)
The farthest zoom is now 1.12.1's `cameraDistanceMax × cameraDistanceMaxFactor`, held to 0 and 50 yd by the reference's two ordered compares (`0x5112d6`–`0x51131e`), and a NaN factor no longer crashes the first wheel notch.

- `cameraDistanceMax` is registered, default "15.0" (`0x84fbd0`), with its validator's range: `0x50b310` → `0x50b330(v, 0.0, 50.0)` accepts 0 to 50 and refuses the rest, NaN included, keeping the old value.
- `cameraDistanceMaxFactor` takes any value, as the reference registers it with no validator: `/console cameraDistanceMaxFactor 3` zooms to 45 yd. The options slider keeps its 1 to 2 range (`UIOptionsFrame.lua:90`).
- Below 0 the limit is 0; at or above 50 it is 50; a NaN product compares unordered and gives 50, as the x87 flags do. The wheel bounds the distance with `max`/`min`, never `f32::clamp` on a CVar-fed bound.
- A distance read back from the saved pose is capped at 50, not 30.
- The zoom moves to its own module, `player/camera_zoom.rs`, keeping `camera.rs` under the line budget.

Fixes #460

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 20:40:06 +07:00
..