Skip to content

Commit

Permalink
Fix incorrect distance calculation in .npc sel
Browse files Browse the repository at this point in the history
  • Loading branch information
KalopsiaTwilight committed Mar 18, 2024
1 parent ae95602 commit 6db3969
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/scripts/Commands/cs_npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,7 @@ class npc_commandscript : public CommandScript
sFreedomMgr->SetCreatureSelectionForPlayer(source->GetGUID().GetCounter(), entryId);

float objX, objY, objZ;
creature->GetPosition(x, y, z);
creature->GetPosition(objX, objY, objZ);

double creatureDist = std::sqrt(std::pow(objX - x, 2) + std::pow(objY - y, 2) + std::pow(objZ - z, 2));

Expand Down

0 comments on commit 6db3969

Please sign in to comment.