Ticket #4473: worksonfirstsight.patch
File worksonfirstsight.patch, 2.1 KB (added by , 6 years ago) |
---|
-
source/simulation2/components/CCmpUnitMotion.cpp
private: 658 658 /** 659 659 * Returns an appropriate obstruction filter for use with path requests. 660 660 * noTarget is true only when used inside tryGoingStraightToTargetEntity, 661 661 * in which case we do not want the target obstruction otherwise it would always fail 662 662 */ 663 ControlGroupMovementObstructionFilter GetObstructionFilter( bool noTarget = false) const;663 ControlGroupMovementObstructionFilter GetObstructionFilter() const; 664 664 665 665 /** 666 666 * Start moving to the given goal, from our current position 'from'. 667 667 * Might go in a straight line immediately, or might start an asynchronous 668 668 * path request. … … bool CCmpUnitMotion::TryGoingStraightToT 1137 1137 1138 1138 // Find the point on the goal shape that we should head towards 1139 1139 CFixedVector2D goalPos = goal.NearestPointOnGoal(from); 1140 1140 1141 1141 // 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)) 1143 1143 return false; 1144 1144 1145 1145 // That route is okay, so update our path 1146 1146 m_FinalGoal = goal; 1147 1147 m_LongPath.m_Waypoints.clear(); … … void CCmpUnitMotion::FaceTowardsPointFro 1271 1271 return; 1272 1272 cmpPosition->TurnTo(angle); 1273 1273 } 1274 1274 } 1275 1275 1276 ControlGroupMovementObstructionFilter CCmpUnitMotion::GetObstructionFilter( bool noTarget) const1276 ControlGroupMovementObstructionFilter CCmpUnitMotion::GetObstructionFilter() const 1277 1277 { 1278 entity_id_t group = noTarget ? m_TargetEntity : GetGroup(); 1279 return ControlGroupMovementObstructionFilter(ShouldAvoidMovingUnits(), group); 1278 return ControlGroupMovementObstructionFilter(ShouldAvoidMovingUnits(), GetGroup()); 1280 1279 } 1281 1280 1282 1281 1283 1282 1284 1283 void CCmpUnitMotion::BeginPathing(const CFixedVector2D& from, const PathGoal& goal)