Skip to content

Commit

Permalink
Merge pull request #2147 from madratman/PR/sun-fix
Browse files Browse the repository at this point in the history
Prevent Environment from crashing when there is no sun UObject in the scene
  • Loading branch information
madratman authored Aug 21, 2019
2 parents f44b8e1 + f79e138 commit 2d53a79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ void ASimModeBase::initializeTimeOfDay()
UObjectProperty* sun_prop = Cast<UObjectProperty>(p);
UObject* sun_obj = sun_prop->GetObjectPropertyValue_InContainer(sky_sphere_);
sun_ = Cast<ADirectionalLight>(sun_obj);
default_sun_rotation_ = sun_->GetActorRotation();
if (sun_)
default_sun_rotation_ = sun_->GetActorRotation();
}
}

Expand Down

0 comments on commit 2d53a79

Please sign in to comment.