Core/MMAPs: Adjust walkable climb and fix a lot of mmap raycast issues

Port From (https://github.com/TrinityCore/TrinityCore/commit/89afeed41b4f040e4852b35183f30291588662d7)
This commit is contained in:
hondacrx
2022-02-22 14:24:29 -05:00
parent 0600993129
commit c27475ae46
5 changed files with 99 additions and 119 deletions
+6 -5
View File
@@ -53,9 +53,9 @@ namespace Game.Chat
if (para.Equals("true"))
useStraightPath = true;
bool useStraightLine = false;
if (para.Equals("line"))
useStraightLine = true;
bool useRaycast = false;
if (para.Equals("line") || para.Equals("ray") || para.Equals("raycast"))
useRaycast = true;
// unit locations
float x, y, z;
@@ -64,11 +64,12 @@ namespace Game.Chat
// path
PathGenerator path = new(target);
path.SetUseStraightPath(useStraightPath);
bool result = path.CalculatePath(x, y, z, false, useStraightLine);
path.SetUseRaycast(useRaycast);
bool result = path.CalculatePath(x, y, z, false);
var pointPath = path.GetPath();
handler.SendSysMessage("{0}'s path to {1}:", target.GetName(), player.GetName());
handler.SendSysMessage("Building: {0}", useStraightPath ? "StraightPath" : useStraightLine ? "Raycast" : "SmoothPath");
handler.SendSysMessage("Building: {0}", useStraightPath ? "StraightPath" : useRaycast ? "Raycast" : "SmoothPath");
handler.SendSysMessage("Result: {0} - Length: {1} - Type: {2}", (result ? "true" : "false"), pointPath.Length, path.GetPathType());
var start = path.GetStartPosition();