fix: persist action bar config after superceded spell slot upgrade

After automatically upgrading action bar slots to the new spell rank
in handleSupercededSpell, save the character config so the upgraded
slot IDs persist across sessions.
This commit is contained in:
Kelsi 2026-03-13 05:42:24 -07:00
parent 2d587d0d4b
commit 7dc12bb35e

View file

@ -16562,14 +16562,17 @@ void GameHandler::handleSupercededSpell(network::Packet& packet) {
// Update all action bar slots that reference the old spell rank to the new rank.
// This matches the WoW client behaviour: the action bar automatically upgrades
// to the new rank when you train it.
bool barChanged = false;
for (auto& slot : actionBar) {
if (slot.type == ActionBarSlot::SPELL && slot.id == oldSpellId) {
slot.id = newSpellId;
slot.cooldownRemaining = 0.0f;
slot.cooldownTotal = 0.0f;
barChanged = true;
LOG_DEBUG("Action bar slot upgraded: spell ", oldSpellId, " -> ", newSpellId);
}
}
if (barChanged) saveCharacterConfig();
const std::string& newName = getSpellName(newSpellId);
if (!newName.empty()) {