Core/MMaps: Add several safety checks to confirm a valid path generation.
- Address some issues in TargetMovementGenerator. Thanks Chevron
This commit is contained in:
@@ -153,16 +153,18 @@ namespace Movement
|
||||
if (generatePath)
|
||||
{
|
||||
PathGenerator path(unit);
|
||||
path.CalculatePath(dest.x, dest.y, dest.z, forceDestination);
|
||||
MovebyPath(path.GetPath());
|
||||
}
|
||||
else
|
||||
{
|
||||
args.path_Idx_offset = 0;
|
||||
args.path.resize(2);
|
||||
TransportPathTransform transform(unit, args.TransformForTransport);
|
||||
args.path[1] = transform(dest);
|
||||
bool result = path.CalculatePath(dest.x, dest.y, dest.z, forceDestination);
|
||||
if (result && path.GetPathType() & ~PATHFIND_NOPATH)
|
||||
{
|
||||
MovebyPath(path.GetPath());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
args.path_Idx_offset = 0;
|
||||
args.path.resize(2);
|
||||
TransportPathTransform transform(unit, args.TransformForTransport);
|
||||
args.path[1] = transform(dest);
|
||||
}
|
||||
|
||||
Vector3 TransportPathTransform::operator()(Vector3 input)
|
||||
|
||||
Reference in New Issue
Block a user