mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Be explicit about nullptr checks.
Keep travis happy
This commit is contained in:
@@ -2248,9 +2248,8 @@ static void populate_vehicle_type_dropdown(Ride* ride)
|
|||||||
bool selectionShouldBeExpanded;
|
bool selectionShouldBeExpanded;
|
||||||
int32_t rideTypeIterator, rideTypeIteratorMax;
|
int32_t rideTypeIterator, rideTypeIteratorMax;
|
||||||
if (gCheatsShowVehiclesFromOtherTrackTypes
|
if (gCheatsShowVehiclesFromOtherTrackTypes
|
||||||
&& !(
|
&& !(ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE
|
||||||
ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE
|
|| ride->type == RIDE_TYPE_MINI_GOLF))
|
||||||
|| ride->type == RIDE_TYPE_MINI_GOLF))
|
|
||||||
{
|
{
|
||||||
selectionShouldBeExpanded = true;
|
selectionShouldBeExpanded = true;
|
||||||
rideTypeIterator = 0;
|
rideTypeIterator = 0;
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ride* ride = get_ride(_rideIndex);
|
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);
|
log_warning("Invalid game command, ride_id = %u", _rideIndex);
|
||||||
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
||||||
@@ -116,7 +116,7 @@ public:
|
|||||||
GameActionResult::Ptr Execute() const override
|
GameActionResult::Ptr Execute() const override
|
||||||
{
|
{
|
||||||
Ride* ride = get_ride(_rideIndex);
|
Ride* ride = get_ride(_rideIndex);
|
||||||
if (!ride)
|
if (ride == nullptr)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command, ride_id = %u", _rideIndex);
|
log_warning("Invalid game command, ride_id = %u", _rideIndex);
|
||||||
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
||||||
|
|||||||
Reference in New Issue
Block a user