CDM: fix Sacred Weapon / Holy Bulwark duration missing until you cast at login - #1306
Merged
EllesmereGaming merged 2 commits intoAug 11, 2026
Merged
Conversation
… at login A transforming cooldown slot only ever names its base and the form that is live right now, so a fresh session can never observe the pairing for an assigned variant that is not the live form. The claim was therefore missing from the first RebuildSpellRouteMap of the session and the base fell through to whatever a repopulate had assigned, so Sacred Weapon / Holy Bulwark routed old-style until a cast transformed the slot and a later rebuild finally saw the pair. variant->base is static game data, identical on every character and profile, and only its observability is state dependent. Persist the pairs on the SV root beside _capturedOnce_CDM and seed the live table before the first StoreDirect, so a login starts with what earlier sessions learned. StripDefaults only walks keys present in DEFAULTS, so the new root key survives logout untouched.
Review follow-up on the previous commit. GetBaseSpell takes a `spec` argument documented as "overrides may vary by Spec" and we call it without one, so every answer describes the current spec only. EllesmereGaming#842 also saw it tie SV Kill Command to a different ability entirely, so these links are not always a tidy same-ability pair. Persisting them account-wide meant one spec's answer was seeded at login into every other spec and character, where StoreDirect turns it into a varMap claim -- and ResolveCDIDToBar consults varBaseMap before directMap[info.spellID], so a bogus pair would outrank that spell's own explicit assignment. Key the store by spec so each pair stays confined to the state it was measured in, and reload it on spec change. The store also had no way back: StripDefaults never walks the SV root and no profile operation touches the key, so a pair learned wrong was permanent. Add ns.ResetVariantBaseStore and call it from the CDM reset beside the _capturedOnce_CDM clear, and drop pre-release flat-format entries on load.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause: the learned variant->base map was in-memory only, so it was empty at every login. A transforming slot only names its base and the form live right now, so the first
RebuildSpellRouteMapof a session can never observe the pairing for an assigned variant that is not the live one. The claim was missing from the first build and the base fell through to whatever a repopulate had assigned, until a cast transformed the slot and a later rebuild finally saw it.Fix: persist the pairs on the SV root (
_variantBase) and seed them before the firstStoreDirect, keyed by spec sinceGetBaseSpellanswers per spec. Addsns.ResetVariantBaseStore, called from the CDM reset, because nothing else reaches the SV root. There is no API route:GetBaseSpellon a non-live variant,GetOverrideSpell+ignoreOverrideSpellIDon the base, andGetOverrideSpellon the variant were all measured and all refuse to name a form the client is not in.Test: Holy paladin (Lightsmith). Three consecutive full logouts returned the same pairs, and post-login with no input Holy Bulwark renders its recharge countdown immediately. Also covers other override spells (Blessed Hammer, Avenging Crusader, Judgment variants). Note the per-spec scoping was added in review follow-up, after that in-game pass, so the spec-change reload path is not yet exercised live.