1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Merge pull request #8817 from janisozaur/fixes-201903

minor cleanups
This commit is contained in:
Michał Janiszewski
2019-03-03 08:42:33 +01:00
committed by GitHub
5 changed files with 19 additions and 17 deletions

View File

@@ -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);
}

View File

@@ -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<GameActionResult>(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<GameActionResult>(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<GameActionResult>(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);
}

View File

@@ -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);
}

View File

@@ -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<GameActionResult>(
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<GameActionResult>(
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<GameActionResult>(
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<GameActionResult>(
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<GameActionResult>(
GA_ERROR::INVALID_PARAMETERS, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE);
}

View File

@@ -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;
}