From 892d6dc5f78d8706e7bb047cb4633d67d9cd3af0 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Thu, 7 Feb 2019 08:50:36 +0000 Subject: [PATCH] Be explicit about nullptr checks. Keep travis happy --- src/openrct2-ui/windows/Ride.cpp | 5 ++--- src/openrct2/actions/RideSetAppearanceAction.hpp | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 870a92fa16..1b23193faa 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -2248,9 +2248,8 @@ static void populate_vehicle_type_dropdown(Ride* ride) bool selectionShouldBeExpanded; int32_t rideTypeIterator, rideTypeIteratorMax; if (gCheatsShowVehiclesFromOtherTrackTypes - && !( - ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE - || ride->type == RIDE_TYPE_MINI_GOLF)) + && !(ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE + || ride->type == RIDE_TYPE_MINI_GOLF)) { selectionShouldBeExpanded = true; rideTypeIterator = 0; diff --git a/src/openrct2/actions/RideSetAppearanceAction.hpp b/src/openrct2/actions/RideSetAppearanceAction.hpp index fb4bfad3f8..2bde766ae3 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.hpp +++ b/src/openrct2/actions/RideSetAppearanceAction.hpp @@ -76,7 +76,7 @@ public: } Ride* ride = get_ride(_rideIndex); - if (!ride || ride->type == RIDE_TYPE_NULL) + if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { log_warning("Invalid game command, ride_id = %u", _rideIndex); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE); @@ -116,7 +116,7 @@ public: GameActionResult::Ptr Execute() const override { Ride* ride = get_ride(_rideIndex); - if (!ride) + if (ride == nullptr) { log_warning("Invalid game command, ride_id = %u", _rideIndex); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE);