diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.hpp b/src/openrct2/actions/RideEntranceExitPlaceAction.hpp index 8ef9533354..11dd51083f 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.hpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.hpp @@ -62,14 +62,14 @@ public: if (_rideIndex >= MAX_RIDES || _rideIndex == RIDE_ID_NULL) { - log_warning("Invalid game command for ride %u", _rideIndex); + log_warning("Invalid game command for ride %d", (int32_t)_rideIndex); return MakeResult(GA_ERROR::INVALID_PARAMETERS, errorTitle); } Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid game command for ride %u", _rideIndex); + log_warning("Invalid game command for ride %d", (int32_t)_rideIndex); return MakeResult(GA_ERROR::INVALID_PARAMETERS, errorTitle); } @@ -152,7 +152,7 @@ public: Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid game command for ride %u", _rideIndex); + log_warning("Invalid game command for ride %d", (int32_t)_rideIndex); return MakeResult(GA_ERROR::INVALID_PARAMETERS, errorTitle); } diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.hpp b/src/openrct2/actions/RideEntranceExitRemoveAction.hpp index 7e8d10fa0f..c13f1deaa3 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.hpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.hpp @@ -49,14 +49,14 @@ public: { if (_rideIndex >= MAX_RIDES || _rideIndex == RIDE_ID_NULL) { - log_warning("Invalid game command for ride %u", uint32_t(_rideIndex)); + log_warning("Invalid game command for ride %d", int32_t(_rideIndex)); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid ride id %u for entrance/exit removal", _rideIndex); + log_warning("Invalid ride id %d for entrance/exit removal", (int32_t)_rideIndex); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } @@ -106,7 +106,8 @@ public: if (!found) { log_warning( - "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, _rideIndex, _stationNum); + "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, (int32_t)_rideIndex, + _stationNum); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } @@ -118,7 +119,7 @@ public: Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid ride id %u for entrance/exit removal", _rideIndex); + log_warning("Invalid ride id %d for entrance/exit removal", (int32_t)_rideIndex); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } @@ -162,7 +163,8 @@ public: if (!found) { log_warning( - "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, _rideIndex, _stationNum); + "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, (int32_t)_rideIndex, + _stationNum); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } diff --git a/src/openrct2/actions/RideSetSetting.hpp b/src/openrct2/actions/RideSetSetting.hpp index f0a8022e60..6478bde798 100644 --- a/src/openrct2/actions/RideSetSetting.hpp +++ b/src/openrct2/actions/RideSetSetting.hpp @@ -62,14 +62,14 @@ public: { if (_rideIndex >= MAX_RIDES || _rideIndex < 0) { - log_warning("Invalid game command for ride %u", uint32_t(_rideIndex)); + log_warning("Invalid game command for ride %d", int32_t(_rideIndex)); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_CHANGE_OPERATING_MODE); } Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid ride: #%u.", _rideIndex); + log_warning("Invalid ride: #%d.", (int32_t)_rideIndex); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_CHANGE_OPERATING_MODE); } @@ -174,7 +174,7 @@ public: Ride* ride = get_ride(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid ride: #%u.", _rideIndex); + log_warning("Invalid ride: #%d.", (int32_t)_rideIndex); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_CHANGE_OPERATING_MODE); } diff --git a/src/openrct2/actions/TrackPlaceAction.hpp b/src/openrct2/actions/TrackPlaceAction.hpp index 70dbd29803..74dab23c72 100644 --- a/src/openrct2/actions/TrackPlaceAction.hpp +++ b/src/openrct2/actions/TrackPlaceAction.hpp @@ -67,20 +67,20 @@ public: Ride* ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride for track placement, rideIndex = %d", _rideIndex); + log_warning("Invalid ride for track placement, rideIndex = %d", (int32_t)_rideIndex); return std::make_unique( GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } if (ride->type == RIDE_TYPE_NULL) { - log_warning("Invalid ride type, rideIndex = %d", _rideIndex); + log_warning("Invalid ride type, rideIndex = %d", (int32_t)_rideIndex); return std::make_unique( GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (rideEntry == nullptr) { - log_warning("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex); + log_warning("Invalid ride subtype for track placement, rideIndex = %d", (int32_t)_rideIndex); return std::make_unique( GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } @@ -414,7 +414,7 @@ public: Ride* ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride for track placement, rideIndex = %d", _rideIndex); + log_warning("Invalid ride for track placement, rideIndex = %d", (int32_t)_rideIndex); return std::make_unique( GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE); } @@ -422,7 +422,7 @@ public: rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (rideEntry == nullptr) { - log_warning("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex); + log_warning("Invalid ride subtype for track placement, rideIndex = %d", (int32_t)_rideIndex); return std::make_unique( GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE); } diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 3e21c8d61b..ae9df02b6a 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -169,7 +169,7 @@ typedef uint8_t Direction; return dir ^ 2; } -constexpr bool direction_valid(Direction dir) +[[maybe_unused]] static constexpr bool direction_valid(Direction dir) { return dir < 4; }