aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/SpellHandler.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-04-18 17:29:14 +0200
committerShauren <shauren.trinity@gmail.com>2015-04-18 17:29:14 +0200
commitf79f76555218e6462278092ba95ae6187be81be6 (patch)
treefa968b621dec099c457685bd327d01e52553c132 /src/server/game/Handlers/SpellHandler.cpp
parentca5c939a8951dfb9c5da0757c4c16c00de5a46c5 (diff)
Core/Spells: Fixed crash happening during character creation when adding initial spells with SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN
Closes #14569
Diffstat (limited to 'src/server/game/Handlers/SpellHandler.cpp')
-rw-r--r--src/server/game/Handlers/SpellHandler.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index 824b747b9f8..25a93b73483 100644
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -634,28 +634,5 @@ void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket)
void WorldSession::HandleRequestCategoryCooldowns(WorldPackets::Spells::RequestCategoryCooldowns& /*requestCategoryCooldowns*/)
{
- SendSpellCategoryCooldowns();
-}
-
-void WorldSession::SendSpellCategoryCooldowns()
-{
- WorldPackets::Spells::CategoryCooldown cooldowns;
-
- Unit::AuraEffectList const& categoryCooldownAuras = _player->GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN);
- for (AuraEffect* aurEff : categoryCooldownAuras)
- {
- uint32 categoryId = aurEff->GetMiscValue();
- auto cItr = std::find_if(cooldowns.CategoryCooldowns.begin(), cooldowns.CategoryCooldowns.end(),
- [categoryId](WorldPackets::Spells::CategoryCooldown::CategoryCooldownInfo const& cooldown)
- {
- return cooldown.Category == categoryId;
- });
-
- if (cItr == cooldowns.CategoryCooldowns.end())
- cooldowns.CategoryCooldowns.emplace_back(aurEff->GetMiscValue(), -aurEff->GetAmount());
- else
- cItr->ModCooldown -= aurEff->GetAmount();
- }
-
- SendPacket(cooldowns.Write());
+ _player->SendSpellCategoryCooldowns();
}