From 96ff1894ee85327cc34ab97c367b15c465c0afa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Wed, 4 Nov 2020 12:24:32 +0100 Subject: [PATCH] Remove unnecessary parameter from Ride::Open (#13368) Ride::Open is only ever called with RIDE_STATUS_OPEN, so the parameter is redundant. --- src/openrct2/actions/RideSetStatus.hpp | 4 ++-- src/openrct2/ride/Ride.cpp | 4 ++-- src/openrct2/ride/Ride.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/actions/RideSetStatus.hpp b/src/openrct2/actions/RideSetStatus.hpp index 6b8e76d2b9..6fed33f790 100644 --- a/src/openrct2/actions/RideSetStatus.hpp +++ b/src/openrct2/actions/RideSetStatus.hpp @@ -110,7 +110,7 @@ public: } else if (_status == RIDE_STATUS_OPEN) { - if (!ride->Open(_status == RIDE_STATUS_OPEN, false)) + if (!ride->Open(false)) { res->Error = GameActions::Status::Unknown; res->ErrorMessage = gGameCommandErrorText; @@ -220,7 +220,7 @@ public: return res; } } - else if (!ride->Open(_status == RIDE_STATUS_OPEN, true)) + else if (!ride->Open(true)) { res->Error = GameActions::Status::Unknown; res->ErrorMessage = gGameCommandErrorText; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 682bf1ef75..2baa677372 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -5241,7 +5241,7 @@ bool Ride::Test(int32_t newStatus, bool isApplying) * * rct2: 0x006B4EEA */ -bool Ride::Open(int32_t goingToBeOpen, bool isApplying) +bool Ride::Open(bool isApplying) { CoordsXYE trackElement, problematicTrackElement = {}; @@ -5266,7 +5266,7 @@ bool Ride::Open(int32_t goingToBeOpen, bool isApplying) return false; } - if (goingToBeOpen && isApplying) + if (isApplying) { ChainQueues(); lifecycle_flags |= RIDE_LIFECYCLE_EVER_BEEN_OPENED; diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 62e809c073..f87dc8ddeb 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -409,7 +409,7 @@ public: void StopGuestsQueuing(); - bool Open(int32_t goingToBeOpen, bool isApplying); + bool Open(bool isApplying); bool Test(int32_t newStatus, bool isApplying); RideMode GetDefaultMode() const;