mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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:
parent
2d587d0d4b
commit
7dc12bb35e
1 changed files with 3 additions and 0 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue