From e70790576414dde16b56fd828d52a79ef540d3e9 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 26 Mar 2015 21:51:19 -0300 Subject: Port commit 56186319bdd41dd26b6cc14f84e6e41eef5d953b (6.x branch) Core/Spells: Cooldown updates Updates #14418 --- src/server/scripts/Commands/cs_misc.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 0b74eb6bee7..a43416dc67d 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -35,6 +35,7 @@ #include "GroupMgr.h" #include "MMapFactory.h" #include "DisableMgr.h" +#include "SpellHistory.h" class misc_commandscript : public CommandScript { @@ -708,7 +709,7 @@ public: if (!*args) { - target->RemoveAllSpellCooldown(); + target->GetSpellHistory()->ResetAllCooldowns(); handler->PSendSysMessage(LANG_REMOVEALL_COOLDOWN, nameLink.c_str()); } else @@ -718,14 +719,15 @@ public: if (!spellIid) return false; - if (!sSpellMgr->GetSpellInfo(spellIid)) + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellIid); + if (!spellInfo) { handler->PSendSysMessage(LANG_UNKNOWN_SPELL, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str()); handler->SetSentErrorMessage(true); return false; } - target->RemoveSpellCooldown(spellIid, true); + target->GetSpellHistory()->ResetCooldown(spellIid, true); handler->PSendSysMessage(LANG_REMOVE_COOLDOWN, spellIid, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str()); } return true; -- cgit v1.2.3