Audio: AmmoBin AmmoState + chain its attribute index -> ZERO state-watcher skips (task #50)

AmmoBin::AttributeIndex was a bare, default-constructed static with NO parent
chain, so nothing resolved on an AmmoBin -- even the inherited SimulationState
came back NULL (the audio AmmoState + SimulationState watchers were skipped).

- Chain AmmoBin::AttributeIndex to HeatWatcher::GetAttributeIndex() and give it a
  real AttributePointers[] with AmmoState -> ammoAlarm (@0x194, the 6-level 0x54
  StateIndicator-compatible feed alarm, already SetLevel'd Feeding/Loaded/Empty/
  Dumped by the sim) so reload/empty/feed audio fires on the ammo transition.

With this every StateIndicator audio attribute across the mech + all subsystems
binds to a real indicator: audiostate skips 85 -> 0.  Remaining audio gaps are the
inert Logical/Scalar/Enum subsystem attrs (ReportLeak/GeneratorOn/ConfigureActive
Press/MotionState/SpeedOfTorsoHorizontal/TargetRangeExponent), which read 0 (silent,
non-crashing) pending backing members in their size-locked layouts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-15 21:41:28 -05:00
co-authored by Claude Opus 4.8
parent 5ba541ed56
commit 0e05a22a55
2 changed files with 26 additions and 1 deletions
+15 -1
View File
@@ -94,7 +94,21 @@ Derivation
);
Receiver::MessageHandlerSet AmmoBin::MessageHandlers;
Simulation::AttributeIndexSet AmmoBin::AttributeIndex;
// AmmoState -> ammoAlarm (@0x194). Chained to HeatWatcher so the inherited
// SimulationState (and any parent attrs) resolve -- the old bare AttributeIndex
// had no parent, so nothing resolved on an AmmoBin.
const AmmoBin::IndexEntry
AmmoBin::AttributePointers[]=
{
ATTRIBUTE_ENTRY(AmmoBin, AmmoState, ammoAlarm) // @0x194 (0x54 StateIndicator-compatible feed alarm)
};
Simulation::AttributeIndexSet AmmoBin::AttributeIndex(
ELEMENTS(AmmoBin::AttributePointers),
AmmoBin::AttributePointers,
HeatWatcher::GetAttributeIndex()
);
AmmoBin::SharedData
AmmoBin::DefaultData( // resolved as &DAT_005125bc
+11
View File
@@ -113,6 +113,17 @@
StateCount
};
// Attribute Support -- audio binds an AudioStateWatcher to AmmoState; it
// resolves to ammoAlarm (@0x194, a 0x54 StateIndicator-compatible alarm) so
// the feed/reload/empty audio fires on the AmmoState transition. The static
// AttributeIndex (ammobin.cpp) is now chained to HeatWatcher -- previously it
// was a bare, unchained index, so even SimulationState resolved to NULL.
enum {
AmmoStateAttributeID = HeatWatcher::NextAttributeID,
NextAttributeID
};
static const IndexEntry AttributePointers[];
typedef void
(AmmoBin::*Performance)(Scalar time_slice);