Fix crash in simulation mode
This commit is contained in:
parent
a3f0c6811f
commit
b9e781c01d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue