Fix crash in simulation mode

This commit is contained in:
nsubiron 2017-09-28 11:35:08 +02:00
parent a3f0c6811f
commit b9e781c01d
1 changed files with 8 additions and 0 deletions

View File

@ -139,7 +139,15 @@ void AWheeledVehicleAIController::SetFixedRoute(const TArray<FVector> &Locations
void AWheeledVehicleAIController::TickAutopilotController()
{
#if WITH_EDITOR
if (Vehicle == nullptr) { // This happens in simulation mode in editor.
bAutopilotEnabled = false;
return;
}
#endif // WITH_EDITOR
check(Vehicle != nullptr);
if (RoadMap == nullptr) {
UE_LOG(LogCarla, Error, TEXT("Controller doesn't have a road map!"));
return;