From ca32357dad128c5358fbf5ea3998ded7ee85e7ec Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 28 May 2019 22:05:15 +0100 Subject: [PATCH] Use bool for isApplying --- src/openrct2/actions/RideSetStatus.hpp | 10 +++++----- src/openrct2/ride/Ride.cpp | 4 ++-- src/openrct2/ride/Ride.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2/actions/RideSetStatus.hpp b/src/openrct2/actions/RideSetStatus.hpp index b3a94a36c3..bcf3245ba1 100644 --- a/src/openrct2/actions/RideSetStatus.hpp +++ b/src/openrct2/actions/RideSetStatus.hpp @@ -83,7 +83,7 @@ public: } else if (_status == RIDE_STATUS_TESTING || _status == RIDE_STATUS_SIMULATING) { - if (!ride_is_valid_for_test(ride, _status, 0)) + if (!ride_is_valid_for_test(ride, _status, false)) { res->Error = GA_ERROR::UNKNOWN; res->ErrorMessage = gGameCommandErrorText; @@ -92,7 +92,7 @@ public: } else if (_status == RIDE_STATUS_OPEN) { - if (!ride_is_valid_for_open(ride, _status == RIDE_STATUS_OPEN, 0)) + if (!ride_is_valid_for_open(ride, _status == RIDE_STATUS_OPEN, false)) { res->Error = GA_ERROR::UNKNOWN; res->ErrorMessage = gGameCommandErrorText; @@ -153,7 +153,7 @@ public: ride_clear_for_construction(ride); ride_remove_peeps(ride); - if (!ride_is_valid_for_test(ride, _status, 1)) + if (!ride_is_valid_for_test(ride, _status, true)) { res->Error = GA_ERROR::UNKNOWN; res->ErrorMessage = gGameCommandErrorText; @@ -194,14 +194,14 @@ public: if (_status == RIDE_STATUS_TESTING) { - if (!ride_is_valid_for_test(ride, _status, 1)) + if (!ride_is_valid_for_test(ride, _status, true)) { res->Error = GA_ERROR::UNKNOWN; res->ErrorMessage = gGameCommandErrorText; return res; } } - else if (!ride_is_valid_for_open(ride, _status == RIDE_STATUS_OPEN, 1)) + else if (!ride_is_valid_for_open(ride, _status == RIDE_STATUS_OPEN, true)) { res->Error = GA_ERROR::UNKNOWN; res->ErrorMessage = gGameCommandErrorText; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 140cb4dfe4..30e26f8fa7 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -5407,7 +5407,7 @@ static TileElement* loc_6B4F6B(ride_id_t rideIndex, int32_t x, int32_t y) return nullptr; } -int32_t ride_is_valid_for_test(Ride* ride, int32_t status, int32_t isApplying) +int32_t ride_is_valid_for_test(Ride* ride, int32_t status, bool isApplying) { int32_t stationIndex; CoordsXYE trackElement, problematicTrackElement = {}; @@ -5546,7 +5546,7 @@ int32_t ride_is_valid_for_test(Ride* ride, int32_t status, int32_t isApplying) * * rct2: 0x006B4EEA */ -int32_t ride_is_valid_for_open(Ride* ride, int32_t goingToBeOpen, int32_t isApplying) +int32_t ride_is_valid_for_open(Ride* ride, int32_t goingToBeOpen, bool isApplying) { int32_t stationIndex; CoordsXYE trackElement, problematicTrackElement = {}; diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index ce2826af24..8b115a0470 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -1075,8 +1075,8 @@ void ride_measurements_update(); rct_ride_measurement* ride_get_measurement(Ride* ride, rct_string_id* message); void ride_breakdown_add_news_item(Ride* ride); Peep* ride_find_closest_mechanic(Ride* ride, int32_t forInspection); -int32_t ride_is_valid_for_open(Ride* ride, int32_t goingToBeOpen, int32_t isApplying); -int32_t ride_is_valid_for_test(Ride* ride, int32_t status, int32_t isApplying); +int32_t ride_is_valid_for_open(Ride* ride, int32_t goingToBeOpen, bool isApplying); +int32_t ride_is_valid_for_test(Ride* ride, int32_t status, bool isApplying); int32_t ride_initialise_construction_window(Ride* ride); void ride_construction_invalidate_current_track(); int32_t sub_6C683D(