From 2f5870e486c110c77487d37382a7693d5b8f0f12 Mon Sep 17 00:00:00 2001 From: Cyd Date: Thu, 16 Jul 2026 23:18:17 -0500 Subject: [PATCH] Cockpit: extend the gauge NULL-source guard to L4MFDSPLIT The single-window cockpit (L4MFDSPLIT=1) wakes the gauge renderer off the pod just like the BT_DEV_GAUGES dev composite does; some attribute sources bind NULL there and AV'd in GaugeConnectionDirectOf. Widen the static dev-gauges gate to also trip on L4MFDSPLIT so those sources bind a static zero (reads 0 instead of faulting). The pod path binds every source, so this stays byte-unchanged there. Co-Authored-By: Claude Opus 4.8 --- engine/MUNGA/GAUGE.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/MUNGA/GAUGE.h b/engine/MUNGA/GAUGE.h index 63d2cba..66978e1 100644 --- a/engine/MUNGA/GAUGE.h +++ b/engine/MUNGA/GAUGE.h @@ -203,9 +203,15 @@ template GaugeConnectionDirectOf::GaugeConnectionDirectOf( // if (data_source == NULL) { + // Desktop gauge modes (BT_DEV_GAUGES dev composite OR L4MFDSPLIT + // single-window cockpit) wake the gauge renderer off the pod, where + // some attribute sources bind NULL; bind a static zero so the gauge + // reads 0 instead of AV'ing here (and in Update()). The pod path + // binds every source, so this never triggers there -- byte-unchanged. static int s_devGauges = -1; if (s_devGauges < 0) - s_devGauges = (getenv("BT_DEV_GAUGES") != NULL) ? 1 : 0; + s_devGauges = (getenv("BT_DEV_GAUGES") != NULL || + getenv("L4MFDSPLIT") != NULL) ? 1 : 0; if (s_devGauges) { static T s_gaugeNullSource = T();