mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-02 10:33:46 +00:00
fix(Scripts/Commands): Fix assertion error on mmaps path command (#13704)
This commit is contained in:
@@ -61,7 +61,7 @@ public:
|
|||||||
return commandTable;
|
return commandTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool HandleMmapPathCommand(ChatHandler* handler, Optional<std::string> para)
|
static bool HandleMmapPathCommand(ChatHandler* handler, Optional<std::string> param)
|
||||||
{
|
{
|
||||||
if (!MMAP::MMapFactory::createOrGetMMapMgr()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()))
|
if (!MMAP::MMapFactory::createOrGetMMapMgr()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()))
|
||||||
{
|
{
|
||||||
@@ -81,14 +81,20 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool useStraightPath = false;
|
bool useStraightPath = false;
|
||||||
if (StringStartsWith("true", *para))
|
|
||||||
useStraightPath = true;
|
|
||||||
|
|
||||||
bool useRaycast = false;
|
bool useRaycast = false;
|
||||||
if (StringStartsWith("line", *para) || StringStartsWith("ray", *para) || StringStartsWith("raycast", *para))
|
if (param)
|
||||||
|
{
|
||||||
|
auto paramValue = param.value();
|
||||||
|
if (paramValue.starts_with("true"))
|
||||||
|
{
|
||||||
|
useStraightPath = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (paramValue.starts_with("line") || paramValue.starts_with("ray") || paramValue.starts_with("raycast"))
|
||||||
{
|
{
|
||||||
useRaycast = true;
|
useRaycast = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// unit locations
|
// unit locations
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
|
|||||||
Reference in New Issue
Block a user