MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / IsOnRoad

Method IsOnRoad

engine/Poseidon/AI/VehicleAIPilot.cpp:526–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526bool 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
544bool EntityAI::IsOnRoadMoving(float minSpeed) const
545{

Callers 3

OperPathMethod · 0.45
FormationPilotMethod · 0.45

Calls 3

GetOnRoadMethod · 0.80
QIsManualFunction · 0.50
SizeMethod · 0.45

Tested by

no test coverage detected