Ticket #4473: worksonfirstsight.patch

File worksonfirstsight.patch, 2.1 KB (added by elexis, 6 years ago)
  • source/simulation2/components/CCmpUnitMotion.cpp

    private:  
    658658    /**
    659659     * Returns an appropriate obstruction filter for use with path requests.
    660660     * noTarget is true only when used inside tryGoingStraightToTargetEntity,
    661661     * in which case we do not want the target obstruction otherwise it would always fail
    662662     */
    663     ControlGroupMovementObstructionFilter GetObstructionFilter(bool noTarget = false) const;
     663    ControlGroupMovementObstructionFilter GetObstructionFilter() const;
    664664
    665665    /**
    666666     * Start moving to the given goal, from our current position 'from'.
    667667     * Might go in a straight line immediately, or might start an asynchronous
    668668     * path request.
    bool CCmpUnitMotion::TryGoingStraightToT  
    11371137
    11381138    // Find the point on the goal shape that we should head towards
    11391139    CFixedVector2D goalPos = goal.NearestPointOnGoal(from);
    11401140
    11411141    // Check if there's any collisions on that route
    1142     if (!cmpPathfinder->CheckMovement(GetObstructionFilter(true), from.X, from.Y, goalPos.X, goalPos.Y, m_Clearance, m_PassClass))
     1142    if (!cmpPathfinder->CheckMovement(GetObstructionFilter(), from.X, from.Y, goalPos.X, goalPos.Y, m_Clearance, m_PassClass))
    11431143        return false;
    11441144
    11451145    // That route is okay, so update our path
    11461146    m_FinalGoal = goal;
    11471147    m_LongPath.m_Waypoints.clear();
    void CCmpUnitMotion::FaceTowardsPointFro  
    12711271            return;
    12721272        cmpPosition->TurnTo(angle);
    12731273    }
    12741274}
    12751275
    1276 ControlGroupMovementObstructionFilter CCmpUnitMotion::GetObstructionFilter(bool noTarget) const
     1276ControlGroupMovementObstructionFilter CCmpUnitMotion::GetObstructionFilter() const
    12771277{
    1278     entity_id_t group = noTarget ? m_TargetEntity : GetGroup();
    1279     return ControlGroupMovementObstructionFilter(ShouldAvoidMovingUnits(), group);
     1278    return ControlGroupMovementObstructionFilter(ShouldAvoidMovingUnits(), GetGroup());
    12801279}
    12811280
    12821281
    12831282
    12841283void CCmpUnitMotion::BeginPathing(const CFixedVector2D& from, const PathGoal& goal)