mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix types passed to printf-like functions
This commit is contained in:
parent
be491d3c6f
commit
70ef8151fc
|
@ -217,7 +217,7 @@ public:
|
||||||
if (tileElement == nullptr)
|
if (tileElement == nullptr)
|
||||||
{
|
{
|
||||||
Ride* ride = get_ride(_rideIndex);
|
Ride* ride = get_ride(_rideIndex);
|
||||||
openrct2_assert(ride != nullptr, "Invalid ride index: %d\n", _rideIndex);
|
openrct2_assert(ride != nullptr, "Invalid ride index: %d\n", uint32_t(_rideIndex));
|
||||||
|
|
||||||
money32 price = (((RideTrackCosts[ride->type].track_price * TrackPricing[TRACK_ELEM_MAZE]) >> 16));
|
money32 price = (((RideTrackCosts[ride->type].track_price * TrackPricing[TRACK_ELEM_MAZE]) >> 16));
|
||||||
res->Cost = price / 2 * 10;
|
res->Cost = price / 2 * 10;
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
Ride* ride = get_ride(_rideIndex);
|
Ride* ride = get_ride(_rideIndex);
|
||||||
if (ride->type == RIDE_TYPE_NULL)
|
if (ride->type == RIDE_TYPE_NULL)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command for ride %u", _rideIndex);
|
log_warning("Invalid game command for ride %u", uint32_t(_rideIndex));
|
||||||
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_CANT_DEMOLISH_RIDE, STR_NONE);
|
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_CANT_DEMOLISH_RIDE, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public:
|
||||||
Ride* ride = get_ride(_rideIndex);
|
Ride* ride = get_ride(_rideIndex);
|
||||||
if (ride->type == RIDE_TYPE_NULL)
|
if (ride->type == RIDE_TYPE_NULL)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command for ride %u", _rideIndex);
|
log_warning("Invalid game command for ride %u", uint32_t(_rideIndex));
|
||||||
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_CANT_DEMOLISH_RIDE, STR_NONE);
|
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_CANT_DEMOLISH_RIDE, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,14 +70,14 @@ public:
|
||||||
{
|
{
|
||||||
if (_rideIndex >= MAX_RIDES || _rideIndex == RIDE_ID_NULL)
|
if (_rideIndex >= MAX_RIDES || _rideIndex == RIDE_ID_NULL)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command for ride %u", _rideIndex);
|
log_warning("Invalid game command for ride %u", uint32_t(_rideIndex));
|
||||||
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ride* ride = get_ride(_rideIndex);
|
Ride* ride = get_ride(_rideIndex);
|
||||||
if (ride == nullptr || 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", uint32_t(_rideIndex));
|
||||||
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ public:
|
||||||
Ride* ride = get_ride(_rideIndex);
|
Ride* ride = get_ride(_rideIndex);
|
||||||
if (ride == nullptr)
|
if (ride == nullptr)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command, ride_id = %u", _rideIndex);
|
log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex));
|
||||||
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
Ride* ride = get_ride(_rideIndex);
|
Ride* ride = get_ride(_rideIndex);
|
||||||
if (ride->type == RIDE_TYPE_NULL)
|
if (ride->type == RIDE_TYPE_NULL)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command for ride %u", _rideIndex);
|
log_warning("Invalid game command for ride %u", uint32_t(_rideIndex));
|
||||||
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE);
|
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ public:
|
||||||
Ride* ride = get_ride(_rideIndex);
|
Ride* ride = get_ride(_rideIndex);
|
||||||
if (ride->type == RIDE_TYPE_NULL)
|
if (ride->type == RIDE_TYPE_NULL)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command for ride %u", _rideIndex);
|
log_warning("Invalid game command for ride %u", uint32_t(_rideIndex));
|
||||||
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE);
|
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ public:
|
||||||
|
|
||||||
if (_rideIndex >= MAX_RIDES || _rideIndex < 0)
|
if (_rideIndex >= MAX_RIDES || _rideIndex < 0)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command for ride %u", _rideIndex);
|
log_warning("Invalid game command for ride %u", uint32_t(_rideIndex));
|
||||||
res->Error = GA_ERROR::INVALID_PARAMETERS;
|
res->Error = GA_ERROR::INVALID_PARAMETERS;
|
||||||
res->ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS;
|
res->ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS;
|
||||||
return res;
|
return res;
|
||||||
|
@ -107,7 +107,7 @@ public:
|
||||||
|
|
||||||
if (ride->type == RIDE_TYPE_NULL)
|
if (ride->type == RIDE_TYPE_NULL)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command for ride %u", _rideIndex);
|
log_warning("Invalid game command for ride %u", uint32_t(_rideIndex));
|
||||||
res->Error = GA_ERROR::INVALID_PARAMETERS;
|
res->Error = GA_ERROR::INVALID_PARAMETERS;
|
||||||
res->ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS;
|
res->ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS;
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -342,9 +342,10 @@ public:
|
||||||
void AddObjectFromFile(const std::string_view& objectName, const void* data, size_t dataSize) override
|
void AddObjectFromFile(const std::string_view& objectName, const void* data, size_t dataSize) override
|
||||||
{
|
{
|
||||||
utf8 path[MAX_PATH];
|
utf8 path[MAX_PATH];
|
||||||
GetPathForNewObject(path, sizeof(path), std::string(objectName).c_str());
|
std::string objectNameString(objectName);
|
||||||
|
GetPathForNewObject(path, sizeof(path), objectNameString.c_str());
|
||||||
|
|
||||||
log_verbose("Adding object: [%s]", objectName);
|
log_verbose("Adding object: [%s]", objectNameString.c_str());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File::WriteAllBytes(path, data, dataSize);
|
File::WriteAllBytes(path, data, dataSize);
|
||||||
|
@ -352,7 +353,7 @@ public:
|
||||||
}
|
}
|
||||||
catch (const std::exception&)
|
catch (const std::exception&)
|
||||||
{
|
{
|
||||||
Console::Error::WriteLine("Failed saving object: [%s] to '%s'.", objectName, path);
|
Console::Error::WriteLine("Failed saving object: [%s] to '%s'.", objectNameString.c_str(), path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue