Skip to content

Commit 1698891

Browse files
committed
update navsystem
1 parent d2e5e14 commit 1698891

File tree

8 files changed

+1497
-1437
lines changed

8 files changed

+1497
-1437
lines changed

api/navsystem/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
public NavPathCallback(NavBuildPathTask:pTask) {
1313
new pEntity = Nav_Path_FindTask_GetUserToken(pTask);
1414
new NavPath:pPath = Nav_Path_FindTask_GetPath(pTask);
15-
new Array:irgSegments = Nav_Path_GetSegments(pPath);
1615
1716
new Array:irgPath = CE_GetMember(pEntity, m_irgPath);
1817
ArrayClear(irgPath);
1918
20-
for (new i = 0; i < ArraySize(irgSegments); ++i) {
21-
new NavPathSegment:pSegment = ArrayGetCell(irgSegments, i);
22-
static Float:vecPos[3];
23-
Nav_Path_Segment_GetPos(pSegment, vecPos);
19+
static iSegmentsNum; iSegmentsNum = Nav_Path_GetSegmentCount(pPath);
20+
21+
for (new iSegment = 0; iSegment < iSegmentsNum; ++iSegment) {
22+
static Float:vecPos[3]; Nav_Path_GetSegmentPos(pPath, iSegment, vecPos);
23+
2424
ArrayPushArray(irgPath, vecPos, sizeof(vecPos));
2525
}
2626

0 commit comments

Comments
 (0)