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

Method ManuallyDeletePath

source/src/bot/bot_waypoint.cpp:924–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

922}
923
924void CWaypointClass::ManuallyDeletePath(vec v_src, int iCmd, bool TwoWay)
925{
926 static node_s *waypoint1 = NULL; // initialized to unassigned
927 static node_s *waypoint2 = NULL; // initialized to unassigned
928
929 if (iCmd == 1) // assign source of path
930 {
931 waypoint1 = GetNearestWaypoint(v_src, 7.0f);
932
933 if (!waypoint1)
934 {
935 conoutf("Error: Couldn't find near waypoint");
936 return;
937 }
938
939 return;
940 }
941
942 if (iCmd == 2) // assign dest of path and delete path
943 {
944 if (!waypoint1)
945 {
946 conoutf("Error: First waypoint unset");
947 return;
948 }
949
950 waypoint2 = GetNearestWaypoint(v_src, 7.0f);
951
952 if (!waypoint2)
953 {
954 conoutf("Error: Couldn't find near waypoint");
955 return;
956 }
957
958 DeletePath(waypoint1, waypoint2);
959
960 if (TwoWay)
961 DeletePath(waypoint2, waypoint1);
962 }
963}
964
965bool CWaypointClass::WPIsReachable(vec from, vec to)
966{

Callers 4

delpath1way1Function · 0.80
delpath1way2Function · 0.80
delpath2way1Function · 0.80
delpath2way2Function · 0.80

Calls 1

conoutfFunction · 0.50

Tested by

no test coverage detected