mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
The 1.12 engine short-circuits a chained same-spell recast: Spell_C_CastSpell bails at `spellID == VAR_CURRENT_CAST_SPELL` before setting the global or firing SPELLCAST_START, so the client never runs its cast path for the 2nd of a back-to-back same-spell cast (common with nampower spell queueing). And the player channel field (+0x228) is server-pushed, landing ~1 tick after the channel starts, so polling it shows the bar ~1s late. Rework the player UnitCastingInfo / UnitChannelInfo tracking into a hybrid: - Normal casts: co-hook FUN_CAST_START_SET, stamp g_cast from the spellID arg before the original (zero latency); cleared by the VAR==0 WorldTick poll. - Chained same-spell recasts: stamp g_cast from the SMSG_SPELL_START co-hook (server castTime), deduped against a fresh client stamp, exempt from the VAR clear, self-expiring on endMs. - Channels: stamp g_channel from the same packet (engine-computed duration) instead of the lagging +0x228 poll; self-expire on endMs. - Cast and channel are mutually exclusive for the player. - Co-hook SMSG_SPELL_DELAYED for cast pushback (extends endMs + delayMs). Add FUN_SPELL_DELAYED and FUN_CAST_START_SET offsets.