[7364] Really implenent server-side anti-cheating cooldown check for spells with SPELL_ATTR_DISABLED_WHILE_ACTIVE. Author: VladimirMangos
Move apply cooldown for like spells to aura apply (GO registering for owner in GO summon spell case)
Store "infinity" cooldown for like spells, ignore it at save and reapply it at aura loading.
Note: one problem still exist for like spells: at loading/far teleport spell icon lost diabled state at client.
Need sedn some unknown data in SendInitialPacketsBeforeAddToMap or SendInitialPacketsAfterAddToMap for restore it state.
--HG--
branch : trunk
This commit is contained in:
@@ -4445,6 +4445,15 @@ void Unit::AddGameObject(GameObject* gameObj)
|
||||
assert(gameObj && gameObj->GetOwnerGUID()==0);
|
||||
m_gameObj.push_back(gameObj);
|
||||
gameObj->SetOwnerGUID(GetGUID());
|
||||
|
||||
if ( GetTypeId()==TYPEID_PLAYER && gameObj->GetSpellId() )
|
||||
{
|
||||
SpellEntry const* createBySpell = sSpellStore.LookupEntry(gameObj->GetSpellId());
|
||||
// Need disable spell use for owner
|
||||
if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
|
||||
// note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases)
|
||||
((Player*)this)->AddSpellAndCategoryCooldowns(createBySpell,0,NULL,true);
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveGameObject(GameObject* gameObj, bool del)
|
||||
|
||||
Reference in New Issue
Block a user