MCPcopy Create free account
hub / github.com/assaultcube/AC / DeleteWaypoint

Method DeleteWaypoint

source/src/bot/bot_waypoint.cpp:821–848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

819}
820
821void 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
850void CWaypointClass::AddPath(node_s *pWP1, node_s *pWP2)
851{

Callers 1

delwpFunction · 0.80

Calls 4

DelWaypointMethod · 0.80
DeleteEntryMethod · 0.80
DeleteAllNodesMethod · 0.80
conoutfFunction · 0.50

Tested by

no test coverage detected