| 524 | } |
| 525 | |
| 526 | bool EntityAI::IsOnRoad() const |
| 527 | { |
| 528 | AIUnit* unit = CommanderUnit(); |
| 529 | if (!unit) |
| 530 | { |
| 531 | return false; |
| 532 | } |
| 533 | if (QIsManual()) |
| 534 | { |
| 535 | return GRoadNet->IsOnRoad(Position(), CollisionSize()) != nullptr; |
| 536 | } |
| 537 | else |
| 538 | { |
| 539 | const Path& path = unit->GetPath(); |
| 540 | return (path.GetOnRoad() && path.Size() >= 2); |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | bool EntityAI::IsOnRoadMoving(float minSpeed) const |
| 545 | { |
no test coverage detected