From d507a7e3388382960108b24143da48e5f912b4a7 Mon Sep 17 00:00:00 2001 From: Treeston Date: Sat, 30 Dec 2017 20:28:41 +0100 Subject: [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 --- src/server/scripts/Commands/cs_cast.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp index 3143c44d567..1d136e23fad 100644 --- a/src/server/scripts/Commands/cs_cast.cpp +++ b/src/server/scripts/Commands/cs_cast.cpp @@ -171,8 +171,7 @@ public: TriggerCastFlags triggered = (triggeredStr != nullptr) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE; float x, y, z; handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, dist); - - handler->GetSession()->GetPlayer()->CastSpell(x, y, z, spellId, triggered); + handler->GetSession()->GetPlayer()->CastSpell({ x, y, z }, spellId, triggered); return true; } @@ -274,7 +273,7 @@ public: } TriggerCastFlags triggered = (triggeredStr != nullptr) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE; - caster->CastSpell(x, y, z, spellId, triggered); + caster->CastSpell({ x, y, z }, spellId, triggered); return true; } -- cgit v1.2.3