mirror of https://github.com/OpenRCT2/OpenRCT2.git
General cleanup of existing error messages
This commit is contained in:
parent
226fc4cb00
commit
40537a17fa
|
@ -113,7 +113,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY&
|
|||
{
|
||||
if (_setting >= LandBuyRightSetting::Count)
|
||||
{
|
||||
LOG_ERROR("Tried calling buy land rights with an incorrect setting %u", _setting);
|
||||
LOG_ERROR("Invalid land buying setting %u", _setting);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE);
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,9 @@ GameActions::Result RideCreateAction::Execute() const
|
|||
const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex);
|
||||
if (rideEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid request for ride %u", rideIndex);
|
||||
LOG_ERROR(
|
||||
"Ride entry not found for index rideEntryIndex %u (from rideType %u, subType %u)", rideEntryIndex, _rideType,
|
||||
_subType);
|
||||
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
|
|
|
@ -100,8 +100,8 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const
|
|||
else if (entranceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR(
|
||||
"Entrance element not found. x = %d, y = %d, ride = %u, station = %u", _loc.x, _loc.y, _rideIndex.ToUnderlying(),
|
||||
_stationNum.ToUnderlying());
|
||||
"Entrance/exit element not found. x = %d, y = %d, ride = %u, station = %u", _loc.x, _loc.y,
|
||||
_rideIndex.ToUnderlying(), _stationNum.ToUnderlying());
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
@ -138,8 +138,8 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const
|
|||
else if (entranceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR(
|
||||
"Entrance element not found. x = %d, y = %d, ride = %u, station = %d", _loc.x, _loc.y, _rideIndex.ToUnderlying(),
|
||||
_stationNum);
|
||||
"Entrance/exit element not found. x = %d, y = %d, ride = %u, station = %d", _loc.x, _loc.y,
|
||||
_rideIndex.ToUnderlying(), _stationNum);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ GameActions::Result RideSetVehicleAction::Query() const
|
|||
{
|
||||
if (_type >= RideSetVehicleType::Count)
|
||||
{
|
||||
LOG_ERROR("Invalid type %d", _type);
|
||||
LOG_ERROR("Invalid ride vehicle type %d", _type);
|
||||
}
|
||||
auto errTitle = SetVehicleTypeErrorTitle[EnumValue(_type)];
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ GameActions::Result ScenarioSetSettingAction::Query() const
|
|||
{
|
||||
if (_setting >= ScenarioSetSetting::Count)
|
||||
{
|
||||
LOG_ERROR("Invalid setting: %u", _setting);
|
||||
LOG_ERROR("Invalid scenario setting: %u", _setting);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
|
|
@ -85,9 +85,7 @@ GameActions::Result StaffHireNewAction::QueryExecute(bool execute) const
|
|||
|
||||
if (_staffType >= static_cast<uint8_t>(StaffType::Count))
|
||||
{
|
||||
// Invalid staff type.
|
||||
LOG_ERROR("Tried to use invalid staff type: %u", static_cast<uint32_t>(_staffType));
|
||||
|
||||
LOG_ERROR("Invalid staff type %u", static_cast<uint32_t>(_staffType));
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -100,18 +98,14 @@ GameActions::Result StaffHireNewAction::QueryExecute(bool execute) const
|
|||
{
|
||||
if (static_cast<uint8_t>(_entertainerType) >= static_cast<uint8_t>(EntertainerCostume::Count))
|
||||
{
|
||||
// Invalid entertainer costume
|
||||
LOG_ERROR("Tried to use invalid entertainer type: %u", static_cast<uint32_t>(_entertainerType));
|
||||
|
||||
LOG_ERROR("Invalid entertainer type %u", static_cast<uint32_t>(_entertainerType));
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE);
|
||||
}
|
||||
|
||||
uint32_t availableCostumes = StaffGetAvailableEntertainerCostumes();
|
||||
if (!(availableCostumes & (1 << static_cast<uint8_t>(_entertainerType))))
|
||||
{
|
||||
// Entertainer costume unavailable
|
||||
LOG_ERROR("Tried to use unavailable entertainer type: %u", static_cast<uint32_t>(_entertainerType));
|
||||
|
||||
LOG_ERROR("Unavailable entertainer costume %u", static_cast<uint32_t>(_entertainerType));
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ GameActions::Result SurfaceSetStyleAction::Query() const
|
|||
|
||||
if (surfaceObj == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid surface style.");
|
||||
LOG_ERROR("Invalid surface style %u", _surfaceStyle);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ GameActions::Result SurfaceSetStyleAction::Query() const
|
|||
|
||||
if (edgeObj == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid edge style.");
|
||||
LOG_ERROR("Invalid edge style %u", _edgeStyle);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
|
|
@ -72,9 +72,9 @@ GameActions::Result TrackPlaceAction::Query() const
|
|||
auto ride = GetRide(_rideIndex);
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
|
||||
LOG_ERROR("Ride not found for rideIndex %d", _rideIndex.ToUnderlying());
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
|
||||
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
const auto* rideEntry = GetRideEntryByIndex(ride->subtype);
|
||||
if (rideEntry == nullptr)
|
||||
|
|
|
@ -129,7 +129,7 @@ GameActions::Result TrackRemoveAction::Query() const
|
|||
auto ride = GetRide(rideIndex);
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found. ride index = %d.", rideIndex);
|
||||
LOG_ERROR("Ride not found for rideIndex %d.", rideIndex);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
|
|
@ -87,7 +87,9 @@ GameActions::Result WallSetColourAction::Query() const
|
|||
auto* wallEntry = wallElement->GetEntry();
|
||||
if (wallEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Could not find wall object");
|
||||
LOG_ERROR(
|
||||
"Wall element does not have wall entry at x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z,
|
||||
_loc.direction);
|
||||
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -139,7 +141,9 @@ GameActions::Result WallSetColourAction::Execute() const
|
|||
auto* wallEntry = wallElement->GetEntry();
|
||||
if (wallEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Could not find wall object");
|
||||
LOG_ERROR(
|
||||
"Wall element does not have wall entry at x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z,
|
||||
_loc.direction);
|
||||
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue