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

Method ManuallyCreatePath

source/src/bot/bot_waypoint.cpp:883–922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881}
882
883void CWaypointClass::ManuallyCreatePath(vec v_src, int iCmd, bool TwoWay)
884{
885 static node_s *waypoint1 = NULL; // initialized to unassigned
886 static node_s *waypoint2 = NULL; // initialized to unassigned
887
888 if (iCmd == 1) // assign source of path
889 {
890 waypoint1 = GetNearestWaypoint(v_src, 7.0f);
891
892 if (!waypoint1)
893 {
894 conoutf("Error: Couldn't find near waypoint");
895 return;
896 }
897
898 return;
899 }
900
901 if (iCmd == 2) // assign dest of path and make path
902 {
903 if (!waypoint1)
904 {
905 conoutf("Error: First waypoint unset");
906 return;
907 }
908
909 waypoint2 = GetNearestWaypoint(v_src, 7.0f);
910
911 if (!waypoint2)
912 {
913 conoutf("Error: Couldn't find near waypoint");
914 return;
915 }
916
917 AddPath(waypoint1, waypoint2);
918
919 if (TwoWay)
920 AddPath(waypoint2, waypoint1);
921 }
922}
923
924void CWaypointClass::ManuallyDeletePath(vec v_src, int iCmd, bool TwoWay)
925{

Callers 4

addpath1way1Function · 0.80
addpath1way2Function · 0.80
addpath2way1Function · 0.80
addpath2way2Function · 0.80

Calls 1

conoutfFunction · 0.50

Tested by

no test coverage detected