| 819 | } |
| 820 | |
| 821 | void CWaypointClass::DeleteWaypoint(vec v_src) |
| 822 | { |
| 823 | node_s *pWP; |
| 824 | |
| 825 | pWP = GetNearestWaypoint(v_src, 7.0f); |
| 826 | |
| 827 | if (!pWP) |
| 828 | { |
| 829 | conoutf("Error: Couldn't find near waypoint"); |
| 830 | return; |
| 831 | } |
| 832 | |
| 833 | BotManager.DelWaypoint(pWP); |
| 834 | |
| 835 | // delete any paths that lead to this index... |
| 836 | DeletePath(pWP); |
| 837 | |
| 838 | short x, y; |
| 839 | GetNodeIndexes(pWP->v_origin, &x, &y); |
| 840 | |
| 841 | m_Waypoints[x][y].DeleteEntry(pWP); |
| 842 | |
| 843 | pWP->ConnectedWPs.DeleteAllNodes(); |
| 844 | pWP->ConnectedWPsWithMe.DeleteAllNodes(); |
| 845 | |
| 846 | m_iWaypointCount--; |
| 847 | delete pWP; |
| 848 | } |
| 849 | |
| 850 | void CWaypointClass::AddPath(node_s *pWP1, node_s *pWP2) |
| 851 | { |
no test coverage detected