diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-01-09 00:27:12 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2023-01-09 00:27:12 +0100 |
commit | d86726e670db5813da48c60dde1d6a59270a3417 (patch) | |
tree | 4a28758b99ed92edb5c69d77fef098ddb48db216 /src | |
parent | 17b20a33531b386eabcd44192a2574de72e64340 (diff) |
Core/Spells: Fixed crash in SpellHistory::ModifySpellCooldown when cooldown is fully reset
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellHistory.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp index d3aa6dfdf09..cf7c87d8929 100644 --- a/src/server/game/Spells/SpellHistory.cpp +++ b/src/server/game/Spells/SpellHistory.cpp @@ -593,9 +593,6 @@ void SpellHistory::ModifySpellCooldown(CooldownStorageType::iterator& itr, Durat itr->second.CooldownEnd = itr->second.CategoryEnd; } - if (itr->second.CooldownEnd <= now) - itr = EraseCooldown(itr); - if (Player* playerOwner = GetPlayerOwner()) { WorldPackets::Spells::ModifyCooldown modifyCooldown; @@ -605,6 +602,9 @@ void SpellHistory::ModifySpellCooldown(CooldownStorageType::iterator& itr, Durat modifyCooldown.WithoutCategoryCooldown = withoutCategoryCooldown; playerOwner->SendDirectMessage(modifyCooldown.Write()); } + + if (itr->second.CooldownEnd <= now) + itr = EraseCooldown(itr); } void SpellHistory::ModifyCooldown(uint32 spellId, Duration cooldownMod, bool withoutCategoryCooldown) |