fix(Scripts/Commands): Fix assertion error on mmaps path command (#13704)
This commit is contained in:
parent
772fe38fe9
commit
2e5e3bda5d
1 changed files with 12 additions and 6 deletions
|
|
@ -61,7 +61,7 @@ public:
|
|||
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()))
|
||||
{
|
||||
|
|
@ -81,13 +81,19 @@ public:
|
|||
}
|
||||
|
||||
bool useStraightPath = false;
|
||||
if (StringStartsWith("true", *para))
|
||||
useStraightPath = true;
|
||||
|
||||
bool useRaycast = false;
|
||||
if (StringStartsWith("line", *para) || StringStartsWith("ray", *para) || StringStartsWith("raycast", *para))
|
||||
if (param)
|
||||
{
|
||||
useRaycast = true;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// unit locations
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue