aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2017-12-30 20:28:41 +0100
committerShauren <shauren.trinity@gmail.com>2021-04-16 15:22:42 +0200
commit9b141207d170e4b2b4e6d9290d5f921f76cbcea0 (patch)
tree47d65d966a66699f6de7e308047e408bdb255bff /src/server/game/Spells/Spell.cpp
parent2ea8f5e6fced094f28c45ac84123c85477122567 (diff)
[3.3.5] CastSpell unclusterfucking (that's a word now) (#21123)
Core/Spell: The giant CastSpell unclusterfucking (that's a word now) of this generation. - CastSpell now always takes three arguments - target, spellId, and a struct containing extra arguments - This struct (CastSpellExtraArgs, see SpellDefines.h) serves as a conglomerate of every previous combination of the 20 billion different CastSpell overloads, all merged into one - It has some great utility constructors - check them out! All of these can be used to implicitly construct the ExtraArgs object. - A gajillion refactors to make everything behave the way it always has (cherry picked from commit d507a7e3388382960108b24143da48e5f912b4a7)
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 0e897c3b109..25e0e56bdf5 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2767,7 +2767,7 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint32 effMask)
{
if (CanExecuteTriggersOnHit(effMask, i->triggeredByAura) && roll_chance_i(i->chance))
{
- m_caster->CastSpell(unit, i->triggeredSpell, TRIGGERED_FULL_MASK);
+ m_caster->CastSpell(unit, i->triggeredSpell->Id, CastSpellExtraArgs(TRIGGERED_FULL_MASK).SetCastDifficulty(i->triggeredSpell->Difficulty));
TC_LOG_DEBUG("spells", "Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->triggeredSpell->Id);
// SPELL_AURA_ADD_TARGET_TRIGGER auras shouldn't trigger auras without duration
@@ -2798,7 +2798,7 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint32 effMask)
if (*i < 0)
unit->RemoveAurasDueToSpell(-(*i));
else
- unit->CastSpell(unit, *i, true, nullptr, nullptr, m_caster->GetGUID());
+ unit->CastSpell(unit, *i, m_caster->GetGUID());
}
}
}
@@ -2916,7 +2916,7 @@ bool Spell::UpdateChanneledTargetList()
return channelTargetEffectMask == 0;
}
-void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura)
+void Spell::prepare(SpellCastTargets const& targets, AuraEffect const* triggeredByAura)
{
if (m_CastItem)
{
@@ -2935,7 +2935,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
}
}
- InitExplicitTargets(*targets);
+ InitExplicitTargets(targets);
m_spellState = SPELL_STATE_PREPARING;
@@ -5597,7 +5597,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
{
if (strict) //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
if (Pet* pet = m_caster->ToPlayer()->GetPet())
- pet->CastSpell(pet, 32752, true, nullptr, nullptr, pet->GetGUID());
+ pet->CastSpell(pet, 32752, pet->GetGUID());
}
else if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET))
return SPELL_FAILED_ALREADY_HAVE_SUMMON;