Ticket #3531: 3531 - Fix DISABLE_PATHFINDER option.patch

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

Rename it to long pathfinder as the short one isn't affected.

  • source/simulation2/components/CCmpUnitMotion.cpp

     
    4141
    4242// For debugging; units will start going straight to the target
    4343// instead of calling the pathfinder
    44 #define DISABLE_PATHFINDER 0
     44#define DISABLE_LONGPATHFINDER 0
    4545
    4646/**
    4747 * When advancing along the long path, and picking a new waypoint to move
     
    13131313    // We are going to recompute our path, so we will use the most recent passability grid
    13141314    m_PassabilityMapChangedRecently = false;
    13151315
    1316 #if DISABLE_PATHFINDER
     1316#if DISABLE_LONGPATHFINDER
    13171317    {
    13181318        CmpPtr<ICmpPathfinder> cmpPathfinder (GetSimContext(), SYSTEM_ENTITY);
    1319         CFixedVector2D goalPos = cmpPathfinder->GetNearestPointOnGoal(from, m_FinalGoal);
     1319        CFixedVector2D goalPos = m_FinalGoal.NearestPointOnGoal(from);
    13201320        m_LongPath.m_Waypoints.clear();
    13211321        m_ShortPath.m_Waypoints.clear();
    13221322        m_ShortPath.m_Waypoints.emplace_back(Waypoint{ goalPos.X, goalPos.Y });