Core/Spells: Fixed crash in SpellHistory::ModifySpellCooldown when cooldown is fully reset
Port From (https://github.com/TrinityCore/TrinityCore/commit/d86726e670db5813da48c60dde1d6a59270a3417)
This commit is contained in:
@@ -539,12 +539,6 @@ namespace Game.Spells
|
||||
cooldownEntry.CooldownEnd = cooldownEntry.CategoryEnd;
|
||||
}
|
||||
|
||||
if (cooldownEntry.CooldownEnd <= now)
|
||||
{
|
||||
_categoryCooldowns.Remove(cooldownEntry.CategoryId);
|
||||
_spellCooldowns.Remove(cooldownEntry.SpellId);
|
||||
}
|
||||
|
||||
Player playerOwner = GetPlayerOwner();
|
||||
if (playerOwner)
|
||||
{
|
||||
@@ -555,6 +549,12 @@ namespace Game.Spells
|
||||
modifyCooldown.WithoutCategoryCooldown = withoutCategoryCooldown;
|
||||
playerOwner.SendPacket(modifyCooldown);
|
||||
}
|
||||
|
||||
if (cooldownEntry.CooldownEnd <= now)
|
||||
{
|
||||
_categoryCooldowns.Remove(cooldownEntry.CategoryId);
|
||||
_spellCooldowns.Remove(cooldownEntry.SpellId);
|
||||
}
|
||||
}
|
||||
|
||||
public void ModifyCooldown(uint spellId, TimeSpan cooldownMod, bool withoutCategoryCooldown = false)
|
||||
|
||||
Reference in New Issue
Block a user