Ticket #3785: shortPathfinder.patch
File shortPathfinder.patch, 1.2 KB (added by , 8 years ago) |
---|
-
source/simulation2/components/CCmpPathfinder_Vertex.cpp
656 656 657 657 if (i >= staticShapesNb) 658 658 pathfindClearance = clearance - entity_pos_t::FromInt(1)/2; 659 659 660 660 // Expand the vertexes by the moving unit's collision radius, to find the 661 661 // closest we can get to it 662 662 … … 838 838 else 839 839 { 840 840 npos = vertexes[n].p; 841 // hack to fix cases where a path along an obstruction will end up in an impassable region 842 // TODO fix it properly 843 int i = (npos.X >> Pathfinding::NAVCELL_SIZE_LOG2).ToInt_RoundToNegInfinity(); 844 int j = (npos.Y >> Pathfinding::NAVCELL_SIZE_LOG2).ToInt_RoundToNegInfinity(); 845 if (!IS_PASSABLE(m_Grid->get(i, j), passClass)) 846 continue; 841 847 } 842 848 843 849 // Work out which quadrant(s) we're approaching the new vertex from … … 853 859 // Hack: Always head towards the goal if possible, to avoid missing it if it's 854 860 // inside another unit 855 861 if (n != GOAL_VERTEX_ID) 856 {857 862 continue; 858 }859 863 } 860 864 861 865 bool visible =