| 922 | } |
| 923 | |
| 924 | void 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 | |
| 965 | bool CWaypointClass::WPIsReachable(vec from, vec to) |
| 966 | { |
no test coverage detected