diff --git a/game/reconstructed/mech4.cpp b/game/reconstructed/mech4.cpp index f890a58..c484fe2 100644 --- a/game/reconstructed/mech4.cpp +++ b/game/reconstructed/mech4.cpp @@ -159,6 +159,7 @@ #include // MP match forensics (DEATH/PROJ/SPLASH/RAM event lines) #include "btinput.hpp" // the CONTROLS.MAP + XInput binding engine #include // [aud-tail] strchr -- BT_FIRE_PULSE "on,off" parse (Gitea #5, instrumentation only) +#include // the ring 28Hz dt-accumulator registry (heat.cpp #119 pattern, census item 5) #if !defined(PLAYER_HPP) # include // Player::VehicleDeadMessage -- the death->respawn notification (task #52) #endif @@ -8813,32 +8814,20 @@ void } if (s_ringHz > 0.0f) { - // per-instance dt accumulator (tiny fixed registry -- bench - // scaffolding; a solo bench has one mech, MP a handful) - static const void *s_raKey[16]; - static Scalar s_raAcc[16]; - int slot = -1, freeSlot = -1; - for (int k = 0; k < 16; ++k) + // per-instance dt accumulator -- the heat.cpp #119 static-map + // pattern (unbounded, keyed per instance, no layout growth). + // Replaces the bench-era 16-slot fixed registry, whose silent + // overflow would have reverted a 17th mech to render-cadence + // sampling (cadence census item 5, night17). + static std::map s_ringClock; + Scalar &acc = s_ringClock[this]; + acc += dt; + if (acc < 1.0f / s_ringHz) + ringPush = 0; + else { - if (s_raKey[k] == (const void *)this) { slot = k; break; } - if (s_raKey[k] == 0 && freeSlot < 0) freeSlot = k; - } - if (slot < 0 && freeSlot >= 0) - { - slot = freeSlot; - s_raKey[slot] = (const void *)this; - s_raAcc[slot] = 0.0f; - } - if (slot >= 0) - { - s_raAcc[slot] += dt; - if (s_raAcc[slot] < 1.0f / s_ringHz) - ringPush = 0; - else - { - ringDt = s_raAcc[slot]; - s_raAcc[slot] = 0.0f; - } + ringDt = acc; + acc = 0.0f; } } }