| 881 | } |
| 882 | |
| 883 | void 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 | |
| 924 | void CWaypointClass::ManuallyDeletePath(vec v_src, int iCmd, bool TwoWay) |
| 925 | { |
no test coverage detected