diff --git a/game/reconstructed/ammobin.cpp b/game/reconstructed/ammobin.cpp index 7dbe10e..caa9577 100644 --- a/game/reconstructed/ammobin.cpp +++ b/game/reconstructed/ammobin.cpp @@ -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 diff --git a/game/reconstructed/ammobin.hpp b/game/reconstructed/ammobin.hpp index de82ff7..06d8846 100644 --- a/game/reconstructed/ammobin.hpp +++ b/game/reconstructed/ammobin.hpp @@ -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);