[7364] Really implenent server-side anti-cheating cooldown check for spells with SPELL_ATTR_DISABLED_WHILE_ACTIVE.

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.
This commit is contained in:
VladimirMangos 2009-03-01 10:14:55 +03:00
parent ed6123c804
commit 2b10d8fd71
6 changed files with 74 additions and 35 deletions

View file

@ -2520,13 +2520,10 @@ void Spell::SendSpellCooldown()
return;
Player* _player = (Player*)m_caster;
// Add cooldown for max (disable spell)
// Cooldown started on SendCooldownEvent call
if (m_spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
{
_player->AddSpellCooldown(m_spellInfo->Id, 0, time(NULL) - 1);
// have infinity cooldown but set at aura apply
if(m_spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
return;
}
_player->AddSpellAndCategoryCooldowns(m_spellInfo,m_CastItem ? m_CastItem->GetEntry() : 0, this);
}