Skip to content

Commit 8466581

Browse files
author
Peter Vaiko
committed
test: diagnostic message for NaN
1 parent 3a6cb60 commit 8466581

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

scripts/Waypoint.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ function WaypointNode:setToWaypoint(course, ix, suppressLog)
324324
end
325325
self.ix = newIx
326326
local x, y, z = course:getWaypointPosition(self.ix)
327+
if x ~= x then
328+
CpUtil.infoVehicle(CpDebug.DBG_PPC, course.vehicle, 'PPC: %s waypoint %d position is NaN', getName(self.node), ix)
329+
course:print()
330+
return
331+
end
327332
setTranslation(self.node, x, y, z)
328333
setRotation(self.node, 0, course:getWaypointYRotation(self.ix), 0)
329334
end

0 commit comments

Comments
 (0)