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

Method SyncWaypoints

source/src/bot/bot_waypoint.cpp:2870–2905  ·  view source on GitHub ↗

Makes a waypoint list for this bot based on the list from WaypointClass

Source from the content-addressed store, hash-verified

2868
2869// Makes a waypoint list for this bot based on the list from WaypointClass
2870void CBot::SyncWaypoints()
2871{
2872 short x, y;
2873 TLinkedList<node_s *>::node_s *p;
2874
2875 // Clean everything first
2876 for (x=0;x<MAX_MAP_GRIDS;x++)
2877 {
2878 for (y=0;y<MAX_MAP_GRIDS;y++)
2879 {
2880 while(!m_WaypointList[x][y].Empty())
2881 delete m_WaypointList[x][y].Pop();
2882 }
2883 }
2884
2885 // Sync
2886 for (x=0;x<MAX_MAP_GRIDS;x++)
2887 {
2888 for (y=0;y<MAX_MAP_GRIDS;y++)
2889 {
2890 p = WaypointClass.m_Waypoints[x][y].GetFirst();
2891 while(p)
2892 {
2893 waypoint_s *pWP = new waypoint_s;
2894 pWP->pNode = p->Entry;
2895 m_WaypointList[x][y].AddNode(pWP);
2896
2897#ifndef RELEASE_BUILD
2898 if (!GetWPFromNode(p->Entry)) condebug("Error adding bot wp!");
2899#endif
2900
2901 p = p->next;
2902 }
2903 }
2904 }
2905}
2906
2907#ifdef WP_FLOOD
2908waypoint_s *CBot::GetNearestFloodWP(vec v_origin, float flRange)

Callers 1

CreateBotMethod · 0.80

Calls 5

condebugFunction · 0.85
AddNodeMethod · 0.80
EmptyMethod · 0.45
PopMethod · 0.45
GetFirstMethod · 0.45

Tested by

no test coverage detected