diff options
| author | Shauren <shauren.trinity@gmail.com> | 2021-10-03 19:58:03 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2021-10-03 19:58:03 +0200 |
| commit | cbf1f2883ad1bc611f08af4838d892bf13057490 (patch) | |
| tree | 98bf2a96df0e362b798986166d5625d5d979154b /src/server/scripts/Commands | |
| parent | 555b2d40ecc22eb0ea4bf913b534ffa7197fa6fe (diff) | |
Core/Spells: Reduce number of CastSpell overloads to 1
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_cast.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
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; } |
