Cockpit_active was latched inside ship_render_player_ship(), which only
runs when Viewer_obj is non-null. External, chase, warp-chase, topdown,
free-camera and dead views all null Viewer_obj, so the flag froze at its
last cockpit-view value and cockpitinactive HUD gauges vanished. It was
also read before being written each frame (by the show-ship check and the
shadow helpers), so those decisions lagged a frame on any transition.
Replace it with three functions computed on demand:
- ship_cockpit_enabled(sip): the ship has a cockpit model and cockpits
aren't disabled; used by the Show_ship_only_if_cockpits_enabled checks
- ship_render_player_cockpit(sip): the above, outside topdown view;
replaces three duplicated copies of that expression
- ship_render_player_cockpit_active(): whether the viewer's cockpit is
being rendered this frame; used by the HUD cockpit-view-choice checks
With the predicate correct, the VM_CHASE special cases added for #4804
are no longer needed and are removed. In chase view, cockpitinactive
gauges now also respect pop-up state, No_ets, and setRenderOverride,
which the early return in HudGauge::canRender() used to bypass.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>