return only the waypoints with changing directorn
parent
962d491def
commit
3af153a320
|
@ -443,22 +443,27 @@ namespace OpenSim.Modules.PathFinding
|
|||
PathFinder pathFinder = new PathFinder();
|
||||
Path _pathFindingPath = pathFinder.FindPath(new GridPosition(_startNode.PositionX, _startNode.PositionY), new GridPosition(_targetNode.PositionX, _targetNode.PositionY), _pathFindingGrid);
|
||||
|
||||
if(_pathFindingPath.Type == PathType.Complete)
|
||||
{
|
||||
String _pathString = "";
|
||||
int lastX = 0;
|
||||
int lastY = 0;
|
||||
|
||||
foreach(var _thisEdge in _pathFindingPath.Edges)
|
||||
foreach (var _thisEdge in _pathFindingPath.Edges)
|
||||
{
|
||||
if(lastX != (int)_thisEdge.End.Position.X && lastY != (int)_thisEdge.End.Position.Y)
|
||||
{
|
||||
_pathString += "<" + _thisEdge.End.Position.X + ", " + _thisEdge.End.Position.Y + ", 0>;";
|
||||
lastX = (int)_thisEdge.End.Position.X;
|
||||
lastY = (int)_thisEdge.End.Position.Y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (_pathFindingPath.Type == PathType.Complete)
|
||||
{
|
||||
m_scriptModule.DispatchReply(requestData.ScriptID, 19850, _pathString, requestData.RequestID.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
String _pathString = "";
|
||||
|
||||
foreach (var _thisEdge in _pathFindingPath.Edges)
|
||||
_pathString += "<" + _thisEdge.End.Position.X + ", " + _thisEdge.End.Position.Y + ", 0>;";
|
||||
|
||||
m_scriptModule.DispatchReply(requestData.ScriptID, 19855, _pathString, requestData.RequestID.ToString());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue