Skip to content

Commit

Permalink
Merge pull request #3404 from rajat2004/ue-4.24-compat
Browse files Browse the repository at this point in the history
Add UE4 version check for 4.24 compatibility
  • Loading branch information
Jonathan authored Feb 24, 2021
2 parents 288c90c + e00bc52 commit 487f845
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,13 @@ void ASimModeBase::initializeTimeOfDay()
sky_sphere_ = sky_spheres[0];
static const FName sun_prop_name(TEXT("Directional light actor"));
auto* p = sky_sphere_class_->FindPropertyByName(sun_prop_name);

#if ENGINE_MINOR_VERSION > 24
FObjectProperty* sun_prop = CastFieldChecked<FObjectProperty>(p);
#else
UObjectProperty* sun_prop = Cast<UObjectProperty>(p);
#endif

UObject* sun_obj = sun_prop->GetObjectPropertyValue_InContainer(sky_sphere_);
sun_ = Cast<ADirectionalLight>(sun_obj);
if (sun_)
Expand Down
4 changes: 2 additions & 2 deletions docs/build_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Please see instructions [here](https://github.com/Microsoft/AirSim/blob/master/d

- Make sure you are [registered with Epic Games](https://docs.unrealengine.com/latest/INT/Platforms/Linux/BeginnerLinuxDeveloper/SettingUpAnUnrealWorkflow/1/index.html). This is required to get source code access for Unreal Engine.

- Clone Unreal in your favorite folder and build it (this may take a while!). **Note**: We only support Unreal >= 4.25 at present. We recommend using 4.25.
- Clone Unreal in your favorite folder and build it (this may take a while!). **Note**: We only support Unreal >= 4.24 at present. We recommend using 4.25.

```bash
# go to the folder where you clone GitHub projects
Expand All @@ -35,7 +35,7 @@ make
2. Run the Epic Games Launcher, open the `Library` tab on the left pane.
Click on the `Add Versions` which should show the option to download **Unreal 4.25** as shown below. If you have multiple versions of Unreal installed then **make sure 4.25 is set to `current`** by clicking down arrow next to the Launch button for the version.

**Note**: AirSim also works with UE >= 4.25, however, we recommend 4.25.
**Note**: AirSim also works with UE >= 4.24, however, we recommend 4.25.
**Note**: If you have UE 4.16 or older projects, please see the [upgrade guide](unreal_upgrade.md) to upgrade your projects.

### Build AirSim
Expand Down
2 changes: 1 addition & 1 deletion docs/build_windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
2. Run the Epic Games Launcher, open the `Unreal Engine` tab on the left pane.
Click on the `Install` button on the top right, which should show the option to download **Unreal Engine >= 4.25**. Chose the install location to suit your needs, as shown in the images below. If you have multiple versions of Unreal installed then **make sure the version you are using is set to `current`** by clicking down arrow next to the Launch button for the version.

**Note**: AirSim also works with UE >= 4.25, however, we recommend 4.25.
**Note**: AirSim also works with UE >= 4.24, however, we recommend 4.25.
**Note**: If you have UE 4.16 or older projects, please see the [upgrade guide](unreal_upgrade.md) to upgrade your projects.

![Unreal Engine Tab UI Screenshot](images/ue_install.png)
Expand Down

0 comments on commit 487f845

Please sign in to comment.