aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_mmaps.cpp11
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp10
2 files changed, 8 insertions, 13 deletions
diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp
index 20213f392d2..04d14913170 100644
--- a/src/server/scripts/Commands/cs_mmaps.cpp
+++ b/src/server/scripts/Commands/cs_mmaps.cpp
@@ -85,9 +85,9 @@ public:
if (para && strcmp(para, "true") == 0)
useStraightPath = true;
- bool useStraightLine = false;
- if (para && strcmp(para, "line") == 0)
- useStraightLine = true;
+ bool useRaycast = false;
+ if (para && (strcmp(para, "line") == 0 || strcmp(para, "ray") == 0 || strcmp(para, "raycast") == 0))
+ useRaycast = true;
// unit locations
float x, y, z;
@@ -96,11 +96,12 @@ public:
// path
PathGenerator path(target);
path.SetUseStraightPath(useStraightPath);
- bool result = path.CalculatePath(x, y, z, false, useStraightLine);
+ path.SetUseRaycast(useRaycast);
+ bool result = path.CalculatePath(x, y, z, false);
Movement::PointsArray const& pointPath = path.GetPath();
handler->PSendSysMessage("%s's path to %s:", target->GetName().c_str(), player->GetName().c_str());
- handler->PSendSysMessage("Building: %s", useStraightPath ? "StraightPath" : useStraightLine ? "Raycast" : "SmoothPath");
+ handler->PSendSysMessage("Building: %s", useStraightPath ? "StraightPath" : useRaycast ? "Raycast" : "SmoothPath");
handler->PSendSysMessage("Result: %s - Length: %zu - Type: %u", (result ? "true" : "false"), pointPath.size(), path.GetPathType());
G3D::Vector3 const& start = path.GetStartPosition();
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index 2376a3d13fe..d008fec0db8 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -283,17 +283,11 @@ public:
PathGenerator generatedPath(GetCaster());
generatedPath.SetPathLengthLimit(range);
- bool result = generatedPath.CalculatePath(dest->GetPositionX(), dest->GetPositionY(), dest->GetPositionZ(), false, true);
+ bool result = generatedPath.CalculatePath(dest->GetPositionX(), dest->GetPositionY(), dest->GetPositionZ(), false);
if (generatedPath.GetPathType() & PATHFIND_SHORT)
return SPELL_FAILED_OUT_OF_RANGE;
else if (!result || generatedPath.GetPathType() & PATHFIND_NOPATH)
- {
- result = generatedPath.CalculatePath(dest->GetPositionX(), dest->GetPositionY(), dest->GetPositionZ(), false, false);
- if (generatedPath.GetPathType() & PATHFIND_SHORT)
- return SPELL_FAILED_OUT_OF_RANGE;
- else if (!result || generatedPath.GetPathType() & PATHFIND_NOPATH)
- return SPELL_FAILED_NOPATH;
- }
+ return SPELL_FAILED_NOPATH;
}
else if (dest->GetPositionZ() > GetCaster()->GetPositionZ() + 4.0f)
return SPELL_FAILED_NOPATH;