*Remove some unused containers from Spell class.
--HG-- branch : trunk
This commit is contained in:
@@ -3412,7 +3412,7 @@ void Unit::_UpdateAutoRepeatSpell()
|
||||
}
|
||||
|
||||
// we want to shoot
|
||||
Spell* spell = new Spell(this, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo, true, 0);
|
||||
Spell* spell = new Spell(this, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo, true);
|
||||
spell->prepare(&(m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_targets));
|
||||
|
||||
// all went good, reset attack
|
||||
|
||||
@@ -421,14 +421,13 @@ void SpellCastTargets::write (ByteBuffer & data)
|
||||
data << m_strTarget;
|
||||
}
|
||||
|
||||
Spell::Spell(Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID, Spell** triggeringContainer, bool skipCheck):
|
||||
Spell::Spell(Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID, bool skipCheck):
|
||||
m_spellInfo(sSpellMgr.GetSpellForDifficultyFromSpell(info, Caster)),
|
||||
m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
{
|
||||
m_customAttr = sSpellMgr.GetSpellCustomAttr(m_spellInfo->Id);
|
||||
m_skipCheck = skipCheck;
|
||||
m_selfContainer = NULL;
|
||||
m_triggeringContainer = triggeringContainer;
|
||||
m_referencedFromCurrentSpell = false;
|
||||
m_executedCurrently = false;
|
||||
m_needComboPoints = NeedsComboPoints(m_spellInfo);
|
||||
@@ -493,7 +492,6 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
|
||||
m_spellState = SPELL_STATE_NULL;
|
||||
|
||||
m_TriggerSpells.clear();
|
||||
m_IsTriggeredSpell = triggered;
|
||||
m_CastItem = NULL;
|
||||
|
||||
@@ -3752,11 +3750,6 @@ void Spell::finish(bool ok)
|
||||
m_caster->ToPlayer()->SetSpellModTakingSpell(this, true);
|
||||
}
|
||||
|
||||
// call triggered spell only at successful cast (after clear combo points -> for add some if need)
|
||||
// I assume what he means is that some triggered spells may add combo points
|
||||
if (!m_TriggerSpells.empty())
|
||||
TriggerSpell();
|
||||
|
||||
// Take mods after trigger spell (needed for 14177 to affect 48664)
|
||||
// mods are taken only on succesfull cast and independantly from targets of the spell
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -4703,15 +4696,6 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::TriggerSpell()
|
||||
{
|
||||
for (TriggerSpells::iterator si=m_TriggerSpells.begin(); si != m_TriggerSpells.end(); ++si)
|
||||
{
|
||||
Spell* spell = new Spell(m_caster, (*si), true, m_originalCasterGUID, m_selfContainer, true);
|
||||
spell->prepare(&m_targets); // use original spell original targets
|
||||
}
|
||||
}
|
||||
|
||||
SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
// check cooldowns to prevent cheating
|
||||
|
||||
@@ -415,7 +415,7 @@ class Spell
|
||||
|
||||
typedef std::set<Aura *> UsedSpellMods;
|
||||
|
||||
Spell(Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, Spell** triggeringContainer = NULL, bool skipCheck = false);
|
||||
Spell(Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, bool skipCheck = false);
|
||||
~Spell();
|
||||
|
||||
void prepare(SpellCastTargets const* targets, AuraEffect const * triggeredByAura = NULL);
|
||||
@@ -429,7 +429,6 @@ class Spell
|
||||
void TakeRunePower();
|
||||
void TakeReagents();
|
||||
void TakeCastItem();
|
||||
void TriggerSpell();
|
||||
|
||||
SpellCastResult CheckCast(bool strict);
|
||||
SpellCastResult CheckPetCast(Unit* target);
|
||||
@@ -531,8 +530,6 @@ class Spell
|
||||
|
||||
bool CheckTargetCreatureType(Unit* target) const;
|
||||
|
||||
void AddTriggeredSpell(SpellEntry const* spell) { m_TriggerSpells.push_back(spell); }
|
||||
|
||||
void CleanupTargetList();
|
||||
|
||||
void SetSpellValue(SpellValueMod mod, int32 value);
|
||||
@@ -688,8 +685,6 @@ class Spell
|
||||
// -------------------------------------------
|
||||
|
||||
//List For Triggered Spells
|
||||
typedef std::vector<SpellEntry const*> TriggerSpells;
|
||||
TriggerSpells m_TriggerSpells;
|
||||
typedef std::vector< std::pair<SpellEntry const*, int32> > ChanceTriggerSpells;
|
||||
ChanceTriggerSpells m_ChanceTriggerSpells;
|
||||
|
||||
|
||||
@@ -1773,7 +1773,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
}
|
||||
|
||||
targets.setUnitTarget(unitTarget);
|
||||
Spell* spell = new Spell(m_caster, spellInfo, triggered, m_originalCasterGUID, NULL, true);
|
||||
Spell* spell = new Spell(m_caster, spellInfo, triggered, m_originalCasterGUID, true);
|
||||
if (bp) spell->m_currentBasePoints[0] = SpellMgr::CalculateSpellEffectBaseAmount(bp, spellInfo, 0);
|
||||
spell->prepare(&targets);
|
||||
}
|
||||
@@ -1957,8 +1957,7 @@ void Spell::EffectTriggerSpell(uint32 effIndex)
|
||||
if (unitTarget->ToPlayer()->HasSpellCooldown(spellId))
|
||||
unitTarget->ToPlayer()->RemoveSpellCooldown(spellId);
|
||||
|
||||
// Push stealth to list because it must be handled after combat remove
|
||||
m_TriggerSpells.push_back(spellInfo);
|
||||
triggered_spell_id = spellId;
|
||||
return;
|
||||
}
|
||||
// Demonic Empowerment -- succubus
|
||||
|
||||
Reference in New Issue
Block a user