Ticket #3531: 3531 - Remove DISABLE_PATHFINDER option.patch
File 3531 - Remove DISABLE_PATHFINDER option.patch, 1.3 KB (added by , 9 years ago) |
---|
-
source/simulation2/components/CCmpUnitMotion.cpp
39 39 #include "ps/Profile.h" 40 40 #include "renderer/Scene.h" 41 41 42 // For debugging; units will start going straight to the target43 // instead of calling the pathfinder44 #define DISABLE_PATHFINDER 045 46 42 /** 47 43 * When advancing along the long path, and picking a new waypoint to move 48 44 * towards, we'll pick one that's up to this far from the unit's current … … 1313 1309 // We are going to recompute our path, so we will use the most recent passability grid 1314 1310 m_PassabilityMapChangedRecently = false; 1315 1311 1316 #if DISABLE_PATHFINDER1317 {1318 CmpPtr<ICmpPathfinder> cmpPathfinder (GetSimContext(), SYSTEM_ENTITY);1319 CFixedVector2D goalPos = cmpPathfinder->GetNearestPointOnGoal(from, m_FinalGoal);1320 m_LongPath.m_Waypoints.clear();1321 m_ShortPath.m_Waypoints.clear();1322 m_ShortPath.m_Waypoints.emplace_back(Waypoint{ goalPos.X, goalPos.Y });1323 m_PathState = PATHSTATE_FOLLOWING;1324 return;1325 }1326 #endif1327 1328 1312 // If we're aiming at a target entity and it's close and we can reach 1329 1313 // it in a straight line, then we'll just go along the straight line 1330 1314 // instead of computing a path.