From cbf1f2883ad1bc611f08af4838d892bf13057490 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 3 Oct 2021 19:58:03 +0200 Subject: Core/Spells: Reduce number of CastSpell overloads to 1 --- src/server/scripts/Commands/cs_cast.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 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 e0f4708e945..a444d31f37a 100644 --- a/src/server/scripts/Commands/cs_cast.cpp +++ b/src/server/scripts/Commands/cs_cast.cpp @@ -171,7 +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(Position{ x, y, z }, spellId, triggered); return true; } @@ -260,9 +260,7 @@ public: if (!posX || !posY || !posZ) return false; - float x = float(atof(posX)); - float y = float(atof(posY)); - float z = float(atof(posZ)); + Position dest(atof(posX), atof(posY), atof(posZ)); char* triggeredStr = strtok(nullptr, " "); if (triggeredStr) @@ -273,7 +271,7 @@ public: } TriggerCastFlags triggered = (triggeredStr != nullptr) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE; - caster->CastSpell({ x, y, z }, spellId, triggered); + caster->CastSpell(dest, spellId, triggered); return true; } -- cgit v1.2.3