mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
feat: upgrade action bar slots to new spell rank on supercede
When a spell is superceded (e.g. Fireball Rank 1 -> Rank 2 after training), update any action bar slots referencing the old spell ID to point to the new rank. This matches WoW client behaviour where training a new rank automatically upgrades your action bars so you don't have to manually re-place the spell.
This commit is contained in:
parent
3c704088af
commit
2d587d0d4b
1 changed files with 12 additions and 0 deletions
|
|
@ -16559,6 +16559,18 @@ void GameHandler::handleSupercededSpell(network::Packet& packet) {
|
|||
|
||||
LOG_INFO("Spell superceded: ", oldSpellId, " -> ", newSpellId);
|
||||
|
||||
// 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.
|
||||
for (auto& slot : actionBar) {
|
||||
if (slot.type == ActionBarSlot::SPELL && slot.id == oldSpellId) {
|
||||
slot.id = newSpellId;
|
||||
slot.cooldownRemaining = 0.0f;
|
||||
slot.cooldownTotal = 0.0f;
|
||||
LOG_DEBUG("Action bar slot upgraded: spell ", oldSpellId, " -> ", newSpellId);
|
||||
}
|
||||
}
|
||||
|
||||
const std::string& newName = getSpellName(newSpellId);
|
||||
if (!newName.empty()) {
|
||||
addSystemChatMessage("Upgraded to " + newName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue