*Remove some unused containers from Spell class.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-08-21 21:00:06 +02:00
parent c3343638cb
commit 77bd968c63
4 changed files with 5 additions and 27 deletions
+1 -1
View File
@@ -3412,7 +3412,7 @@ void Unit::_UpdateAutoRepeatSpell()
} }
// we want to shoot // 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)); spell->prepare(&(m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_targets));
// all went good, reset attack // all went good, reset attack
+1 -17
View File
@@ -421,14 +421,13 @@ void SpellCastTargets::write (ByteBuffer & data)
data << m_strTarget; 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_spellInfo(sSpellMgr.GetSpellForDifficultyFromSpell(info, Caster)),
m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo)) m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
{ {
m_customAttr = sSpellMgr.GetSpellCustomAttr(m_spellInfo->Id); m_customAttr = sSpellMgr.GetSpellCustomAttr(m_spellInfo->Id);
m_skipCheck = skipCheck; m_skipCheck = skipCheck;
m_selfContainer = NULL; m_selfContainer = NULL;
m_triggeringContainer = triggeringContainer;
m_referencedFromCurrentSpell = false; m_referencedFromCurrentSpell = false;
m_executedCurrently = false; m_executedCurrently = false;
m_needComboPoints = NeedsComboPoints(m_spellInfo); m_needComboPoints = NeedsComboPoints(m_spellInfo);
@@ -493,7 +492,6 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
m_spellState = SPELL_STATE_NULL; m_spellState = SPELL_STATE_NULL;
m_TriggerSpells.clear();
m_IsTriggeredSpell = triggered; m_IsTriggeredSpell = triggered;
m_CastItem = NULL; m_CastItem = NULL;
@@ -3752,11 +3750,6 @@ void Spell::finish(bool ok)
m_caster->ToPlayer()->SetSpellModTakingSpell(this, true); 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) // 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 // mods are taken only on succesfull cast and independantly from targets of the spell
if (m_caster->GetTypeId() == TYPEID_PLAYER) 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) SpellCastResult Spell::CheckCast(bool strict)
{ {
// check cooldowns to prevent cheating // check cooldowns to prevent cheating
+1 -6
View File
@@ -415,7 +415,7 @@ class Spell
typedef std::set<Aura *> UsedSpellMods; 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(); ~Spell();
void prepare(SpellCastTargets const* targets, AuraEffect const * triggeredByAura = NULL); void prepare(SpellCastTargets const* targets, AuraEffect const * triggeredByAura = NULL);
@@ -429,7 +429,6 @@ class Spell
void TakeRunePower(); void TakeRunePower();
void TakeReagents(); void TakeReagents();
void TakeCastItem(); void TakeCastItem();
void TriggerSpell();
SpellCastResult CheckCast(bool strict); SpellCastResult CheckCast(bool strict);
SpellCastResult CheckPetCast(Unit* target); SpellCastResult CheckPetCast(Unit* target);
@@ -531,8 +530,6 @@ class Spell
bool CheckTargetCreatureType(Unit* target) const; bool CheckTargetCreatureType(Unit* target) const;
void AddTriggeredSpell(SpellEntry const* spell) { m_TriggerSpells.push_back(spell); }
void CleanupTargetList(); void CleanupTargetList();
void SetSpellValue(SpellValueMod mod, int32 value); void SetSpellValue(SpellValueMod mod, int32 value);
@@ -688,8 +685,6 @@ class Spell
// ------------------------------------------- // -------------------------------------------
//List For Triggered Spells //List For Triggered Spells
typedef std::vector<SpellEntry const*> TriggerSpells;
TriggerSpells m_TriggerSpells;
typedef std::vector< std::pair<SpellEntry const*, int32> > ChanceTriggerSpells; typedef std::vector< std::pair<SpellEntry const*, int32> > ChanceTriggerSpells;
ChanceTriggerSpells m_ChanceTriggerSpells; ChanceTriggerSpells m_ChanceTriggerSpells;
+2 -3
View File
@@ -1773,7 +1773,7 @@ void Spell::EffectDummy(uint32 i)
} }
targets.setUnitTarget(unitTarget); 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); if (bp) spell->m_currentBasePoints[0] = SpellMgr::CalculateSpellEffectBaseAmount(bp, spellInfo, 0);
spell->prepare(&targets); spell->prepare(&targets);
} }
@@ -1957,8 +1957,7 @@ void Spell::EffectTriggerSpell(uint32 effIndex)
if (unitTarget->ToPlayer()->HasSpellCooldown(spellId)) if (unitTarget->ToPlayer()->HasSpellCooldown(spellId))
unitTarget->ToPlayer()->RemoveSpellCooldown(spellId); unitTarget->ToPlayer()->RemoveSpellCooldown(spellId);
// Push stealth to list because it must be handled after combat remove triggered_spell_id = spellId;
m_TriggerSpells.push_back(spellInfo);
return; return;
} }
// Demonic Empowerment -- succubus // Demonic Empowerment -- succubus