Ticket #3531: 3531 - Remove DISABLE_PATHFINDER option.patch

File 3531 - Remove DISABLE_PATHFINDER option.patch, 1.3 KB (added by Stan, 9 years ago)

Updated Patch → I misunderstood what you meant.

  • source/simulation2/components/CCmpUnitMotion.cpp

     
    3939#include "ps/Profile.h"
    4040#include "renderer/Scene.h"
    4141
    42 // For debugging; units will start going straight to the target
    43 // instead of calling the pathfinder
    44 #define DISABLE_PATHFINDER 0
    45 
    4642/**
    4743 * When advancing along the long path, and picking a new waypoint to move
    4844 * towards, we'll pick one that's up to this far from the unit's current
     
    13131309    // We are going to recompute our path, so we will use the most recent passability grid
    13141310    m_PassabilityMapChangedRecently = false;
    13151311
    1316 #if DISABLE_PATHFINDER
    1317     {
    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 #endif
    1327 
    13281312    // If we're aiming at a target entity and it's close and we can reach
    13291313    // it in a straight line, then we'll just go along the straight line
    13301314    // instead of computing a path.