Ticket #3376: use_passability_grid.patch
File use_passability_grid.patch, 1.9 KB (added by , 9 years ago) |
---|
-
source/simulation2/components/CCmpPathfinder.cpp
794 794 entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, 795 795 pass_class_t passClass) 796 796 { 797 // Test against obstructions first 797 // Test against obstructions first. Pathfinding-blocking obstructions are not handled here. 798 798 CmpPtr<ICmpObstructionManager> cmpObstructionManager(GetSystemEntity()); 799 if (!cmpObstructionManager )799 if (!cmpObstructionManager || cmpObstructionManager->TestLine(filter, x0, z0, x1, z1, r)) 800 800 return false; 801 801 802 if (cmpObstructionManager->TestLine(filter, x0, z0, x1, z1, r)) 803 return false; 804 805 // Then test against the terrain 806 return Pathfinding::CheckLineMovement(x0, z0, x1, z1, passClass, *m_TerrainOnlyGrid); 802 // Then test against the passability grid. 803 return Pathfinding::CheckLineMovement(x0, z0, x1, z1, passClass, *m_Grid); 807 804 } 808 805 809 806 ICmpObstruction::EFoundationCheck CCmpPathfinder::CheckUnitPlacement(const IObstructionTestFilter& filter, -
source/simulation2/components/ICmpObstructionManager.h
346 346 if (group == m_Group || (group2 != INVALID_ENTITY && group2 == m_Group)) 347 347 return false; 348 348 349 // If an obstruction already blocks tile-based pathfinding, 350 // it will be handled as part of the terrain passability handling 351 // and doesn't need to be matched by this filter 352 if (flags & ICmpObstructionManager::FLAG_BLOCK_PATHFINDING) 353 return false; 354 349 355 if (!(flags & ICmpObstructionManager::FLAG_BLOCK_MOVEMENT)) 350 356 return false; 351 357