Fix some code style issues in previous PR merge
This commit is contained in:
@@ -110,6 +110,7 @@ void CombatAI::UpdateAI(const uint32 diff)
|
|||||||
else
|
else
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CombatAI::SpellInterrupted(uint32 spellId, uint32 unTimeMs)
|
void CombatAI::SpellInterrupted(uint32 spellId, uint32 unTimeMs)
|
||||||
{
|
{
|
||||||
events.RescheduleEvent(spellId, unTimeMs);
|
events.RescheduleEvent(spellId, unTimeMs);
|
||||||
|
|||||||
@@ -241,9 +241,9 @@ class UnitAI
|
|||||||
|
|
||||||
// Called when the unit heals
|
// Called when the unit heals
|
||||||
virtual void HealDone(Unit* /*done_to*/, uint32& /*addhealth*/) {}
|
virtual void HealDone(Unit* /*done_to*/, uint32& /*addhealth*/) {}
|
||||||
|
|
||||||
// Called when a spell is interrupted by Spell::EffectInterruptCast
|
/// Called when a spell is interrupted by Spell::EffectInterruptCast
|
||||||
// Use to reschedule next planned cast of spell.
|
/// Use to reschedule next planned cast of spell.
|
||||||
virtual void SpellInterrupted(uint32 /*spellId*/, uint32 /*unTimeMs*/) {}
|
virtual void SpellInterrupted(uint32 /*spellId*/, uint32 /*unTimeMs*/) {}
|
||||||
|
|
||||||
void AttackStartCaster(Unit* victim, float dist);
|
void AttackStartCaster(Unit* victim, float dist);
|
||||||
|
|||||||
@@ -1308,7 +1308,7 @@ bool CreatureEventAI::CanCast(Unit* target, SpellInfo const* spell, bool trigger
|
|||||||
//Silenced so we can't cast
|
//Silenced so we can't cast
|
||||||
if (!triggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
|
if (!triggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//Check for power
|
//Check for power
|
||||||
if (!triggered && me->GetPower((Powers)spell->PowerType) < spell->CalcPowerCost(me, spell->GetSchoolMask()))
|
if (!triggered && me->GetPower((Powers)spell->PowerType) < spell->CalcPowerCost(me, spell->GetSchoolMask()))
|
||||||
return false;
|
return false;
|
||||||
@@ -1316,7 +1316,7 @@ bool CreatureEventAI::CanCast(Unit* target, SpellInfo const* spell, bool trigger
|
|||||||
//Unit is out of range of this spell
|
//Unit is out of range of this spell
|
||||||
if (!me->IsInRange(target, spell->GetMinRange(false), spell->GetMaxRange(false)))
|
if (!me->IsInRange(target, spell->GetMinRange(false), spell->GetMaxRange(false)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//Spell is on cooldown
|
//Spell is on cooldown
|
||||||
if (me->HasSpellCooldown(spell->Id))
|
if (me->HasSpellCooldown(spell->Id))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -2238,7 +2238,7 @@ void Creature::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs
|
|||||||
{
|
{
|
||||||
if (m_spells[i] == 0)
|
if (m_spells[i] == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
uint32 unSpellId = m_spells[i];
|
uint32 unSpellId = m_spells[i];
|
||||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
|
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
|
||||||
if (!spellInfo)
|
if (!spellInfo)
|
||||||
@@ -2257,10 +2257,9 @@ void Creature::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs
|
|||||||
if ((idSchoolMask & spellInfo->GetSchoolMask()) && GetCreatureSpellCooldownDelay(unSpellId) < unTimeMs)
|
if ((idSchoolMask & spellInfo->GetSchoolMask()) && GetCreatureSpellCooldownDelay(unSpellId) < unTimeMs)
|
||||||
{
|
{
|
||||||
_AddCreatureSpellCooldown(unSpellId, curTime + unTimeMs/IN_MILLISECONDS);
|
_AddCreatureSpellCooldown(unSpellId, curTime + unTimeMs/IN_MILLISECONDS);
|
||||||
if(UnitAI *ai = GetAI())
|
if (UnitAI* ai = GetAI())
|
||||||
ai->SpellInterrupted(unSpellId, unTimeMs);
|
ai->SpellInterrupted(unSpellId, unTimeMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -540,13 +540,13 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
|
|||||||
void AddCreatureSpellCooldown(uint32 spellid);
|
void AddCreatureSpellCooldown(uint32 spellid);
|
||||||
bool HasSpellCooldown(uint32 spell_id) const;
|
bool HasSpellCooldown(uint32 spell_id) const;
|
||||||
bool HasCategoryCooldown(uint32 spell_id) const;
|
bool HasCategoryCooldown(uint32 spell_id) const;
|
||||||
uint32 GetCreatureSpellCooldownDelay(uint32 spell_id) const
|
uint32 GetCreatureSpellCooldownDelay(uint32 spellId) const
|
||||||
{
|
{
|
||||||
CreatureSpellCooldowns::const_iterator itr = m_CreatureSpellCooldowns.find(spell_id);
|
CreatureSpellCooldowns::const_iterator itr = m_CreatureSpellCooldowns.find(spellId);
|
||||||
time_t t = time(NULL);
|
time_t t = time(NULL);
|
||||||
return uint32(itr != m_CreatureSpellCooldowns.end() && itr->second > t ? itr->second - t : 0);
|
return uint32(itr != m_CreatureSpellCooldowns.end() && itr->second > t ? itr->second - t : 0);
|
||||||
}
|
}
|
||||||
virtual void ProhibitSpellSchool(SpellSchoolMask, uint32);
|
virtual void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs);
|
||||||
|
|
||||||
bool HasSpell(uint32 spellID) const;
|
bool HasSpell(uint32 spellID) const;
|
||||||
|
|
||||||
|
|||||||
@@ -2066,7 +2066,7 @@ void Pet::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
|
|||||||
_AddCreatureSpellCooldown(unSpellId, curTime + unTimeMs/IN_MILLISECONDS);
|
_AddCreatureSpellCooldown(unSpellId, curTime + unTimeMs/IN_MILLISECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Player *owner = GetOwner())
|
|
||||||
|
if (Player* owner = GetOwner())
|
||||||
owner->GetSession()->SendPacket(&data);
|
owner->GetSession()->SendPacket(&data);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -200,7 +200,7 @@ class Pet : public Guardian
|
|||||||
bool unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true);
|
bool unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true);
|
||||||
bool removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true);
|
bool removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true);
|
||||||
void CleanupActionBar();
|
void CleanupActionBar();
|
||||||
virtual void ProhibitSpellSchool(SpellSchoolMask, uint32);
|
virtual void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs);
|
||||||
|
|
||||||
PetSpellMap m_spells;
|
PetSpellMap m_spells;
|
||||||
AutoSpellList m_autospells;
|
AutoSpellList m_autospells;
|
||||||
|
|||||||
Reference in New Issue
Block a user