Core/Spells: Removed remaining part of old global cooldown handler

This commit is contained in:
tobmaps
2011-07-23 03:30:43 +07:00
parent 7303adf1eb
commit a0f1a5c789
5 changed files with 4 additions and 64 deletions
+1 -51
View File
@@ -842,8 +842,6 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
for (uint8 i = 0; i < MAX_POWERS; ++i)
m_powerFraction[i] = 0;
m_globalCooldowns.clear();
m_ConditionErrorMsgId = 0;
isDebugAreaTriggers = false;
@@ -1504,17 +1502,6 @@ void Player::Update(uint32 p_time)
m_nextMailDelivereTime = 0;
}
for (std::map<uint32, uint32>::iterator itr = m_globalCooldowns.begin(); itr != m_globalCooldowns.end(); ++itr)
{
if (itr->second)
{
if (itr->second > p_time)
itr->second -= p_time;
else
itr->second = 0;
}
}
// If this is set during update SetSpellModTakingSpell call is missing somewhere in the code
// Having this would prevent more aura charges to be dropped, so let's crash
//ASSERT (!m_spellModTakingSpell);
@@ -12094,7 +12081,7 @@ Item* Player::EquipItem(uint16 pos, Item *pItem, bool update)
{
m_weaponChangeTimer = spellProto->StartRecoveryTime;
AddGlobalCooldown(spellProto, NULL); // NULL spell is safe (needed for serverside GCD
GetGlobalCooldownMgr().AddGlobalCooldown(spellProto, m_weaponChangeTimer);
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4);
data << uint64(GetGUID());
@@ -22922,43 +22909,6 @@ void Player::UpdateCharmedAI()
}
}
void Player::AddGlobalCooldown(SpellEntry const *spellInfo, Spell* spell)
{
if (!spellInfo || !spellInfo->StartRecoveryTime)
return;
float cdTime = float(spellInfo->StartRecoveryTime);
if (!(spellInfo->Attributes & (SPELL_ATTR0_ABILITY|SPELL_ATTR0_PASSIVE)))
cdTime *= GetFloatValue(UNIT_MOD_CAST_SPEED);
else if (IsRangedWeaponSpell(spellInfo) && spell && !spell->IsAutoRepeat())
cdTime *= m_modAttackSpeedPct[RANGED_ATTACK];
if (cdTime > 1500.0f)
cdTime = 1500.0f;
ApplySpellMod(spellInfo->Id, SPELLMOD_GLOBAL_COOLDOWN, cdTime, spell);
if (cdTime > 0)
m_globalCooldowns[spellInfo->StartRecoveryCategory] = uint32(cdTime);
}
bool Player::HasGlobalCooldown(SpellEntry const *spellInfo) const
{
if (!spellInfo)
return false;
std::map<uint32, uint32>::const_iterator itr = m_globalCooldowns.find(spellInfo->StartRecoveryCategory);
return itr != m_globalCooldowns.end() && (itr->second > sWorld->GetUpdateTime());
}
void Player::RemoveGlobalCooldown(SpellEntry const *spellInfo)
{
if (!spellInfo || !spellInfo->StartRecoveryTime)
return;
m_globalCooldowns[spellInfo->StartRecoveryCategory] = 0;
}
uint32 Player::GetRuneBaseCooldown(uint8 index)
{
uint8 rune = GetBaseRune(index);
-6
View File
@@ -1700,11 +1700,6 @@ class Player : public Unit, public GridObject<Player>
void SetLastPotionId(uint32 item_id) { m_lastPotionId = item_id; }
void UpdatePotionCooldown(Spell* spell = NULL);
// global cooldown
void AddGlobalCooldown(SpellEntry const *spellInfo, Spell* spell);
bool HasGlobalCooldown(SpellEntry const *spellInfo) const;
void RemoveGlobalCooldown(SpellEntry const *spellInfo);
void setResurrectRequestData(uint64 guid, uint32 mapId, float X, float Y, float Z, uint32 health, uint32 mana)
{
m_resurrectGUID = guid;
@@ -2754,7 +2749,6 @@ class Player : public Unit, public GridObject<Player>
ReputationMgr m_reputationMgr;
SpellCooldowns m_spellCooldowns;
std::map<uint32, uint32> m_globalCooldowns; // whole start recovery category stored in one
uint32 m_ChampioningFaction;