1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 11:33:03 +01:00

Change LOG_ERROR to LOG_WARNING for errors

This commit is contained in:
Peter Froud
2024-03-16 21:31:03 -07:00
committed by Gymnasiast
parent b5fdcf9a17
commit 23958186bd
27 changed files with 91 additions and 91 deletions

View File

@@ -47,7 +47,7 @@ GameActions::Result BannerSetNameAction::Query() const
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
LOG_WARNING("Invalid banner id, banner id = %d", _bannerIndex);
LOG_ERROR("Invalid banner id, banner id = %d", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE);
}
return GameActions::Result();
@@ -58,7 +58,7 @@ GameActions::Result BannerSetNameAction::Execute() const
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
LOG_WARNING("Invalid banner id, banner id = %d", _bannerIndex);
LOG_ERROR("Invalid banner id, banner id = %d", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE);
}

View File

@@ -69,14 +69,14 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const
auto tileElement = MapGetFootpathElement(_loc);
if (tileElement == nullptr)
{
LOG_WARNING("Could not find path element.");
LOG_ERROR("Could not find path element.");
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
}
auto pathElement = tileElement->AsPath();
if (pathElement == nullptr)
{
LOG_WARNING("Could not find path element.");
LOG_ERROR("Could not find path element.");
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
}

View File

@@ -39,7 +39,7 @@ GameActions::Result GameSetSpeedAction::Query() const
if (!IsValidSpeed(_speed))
{
LOG_WARNING("Invalid game command for speed %u", _speed);
LOG_ERROR("Invalid game command for speed %u", _speed);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@@ -53,7 +53,7 @@ GameActions::Result GameSetSpeedAction::Execute() const
if (!IsValidSpeed(_speed))
{
LOG_WARNING("Invalid game command for speed %u", _speed);
LOG_ERROR("Invalid game command for speed %u", _speed);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}

View File

@@ -64,7 +64,7 @@ GameActions::Result GuestSetNameAction::Query() const
auto guest = TryGetEntity<Guest>(_spriteIndex);
if (guest == nullptr)
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
LOG_ERROR("Invalid game command for sprite %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE);
}
@@ -76,7 +76,7 @@ GameActions::Result GuestSetNameAction::Execute() const
auto guest = TryGetEntity<Guest>(_spriteIndex);
if (guest == nullptr)
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
LOG_ERROR("Invalid game command for sprite %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE);
}

View File

@@ -113,7 +113,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY&
{
if (_setting >= LandBuyRightSetting::Count)
{
LOG_WARNING("Tried calling buy land rights with an incorrect setting. setting = %u", _setting);
LOG_ERROR("Tried calling buy land rights with an incorrect setting. setting = %u", _setting);
return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE);
}
@@ -170,7 +170,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY&
return res;
default:
LOG_WARNING("Tried calling buy land rights with an incorrect setting. setting = %u", _setting);
LOG_ERROR("Tried calling buy land rights with an incorrect setting. setting = %u", _setting);
return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE);
}
}

View File

@@ -205,7 +205,7 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY&
return res;
}
default:
LOG_WARNING("Tried calling set land rights with an incorrect setting. setting = %u", _setting);
LOG_ERROR("Tried calling set land rights with an incorrect setting. setting = %u", _setting);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}

View File

@@ -65,7 +65,7 @@ GameActions::Result LargeSceneryRemoveAction::Query() const
TileElement* tileElement = FindLargeSceneryElement(_loc, _tileIndex);
if (tileElement == nullptr)
{
LOG_WARNING("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y);
LOG_ERROR("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
}
@@ -147,7 +147,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const
TileElement* tileElement = FindLargeSceneryElement(_loc, _tileIndex);
if (tileElement == nullptr)
{
LOG_WARNING("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y);
LOG_ERROR("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
}

View File

@@ -130,7 +130,7 @@ GameActions::Result RideCreateAction::Execute() const
const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex);
if (rideEntry == nullptr)
{
LOG_WARNING("Invalid request for ride %u", rideIndex);
LOG_ERROR("Invalid request for ride %u", rideIndex);
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE);
}

View File

@@ -60,7 +60,7 @@ GameActions::Result RideDemolishAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE);
}
@@ -105,7 +105,7 @@ GameActions::Result RideDemolishAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE);
}

View File

@@ -58,13 +58,13 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE);
}
if (_stationNum.ToUnderlying() >= Limits::MaxStationsPerRide)
{
LOG_WARNING("Invalid station number for ride. stationNum: %u", _stationNum.ToUnderlying());
LOG_ERROR("Invalid station number for ride. stationNum: %u", _stationNum.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE);
}
@@ -143,7 +143,7 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE);
}

View File

@@ -69,7 +69,7 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid ride id %u for entrance/exit removal", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid ride id %u for entrance/exit removal", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
}
@@ -99,7 +99,7 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const
}
else if (entranceElement == nullptr)
{
LOG_WARNING(
LOG_ERROR(
"Entrance element not found. x = %d, y = %d, ride = %u, station = %u", _loc.x, _loc.y, _rideIndex.ToUnderlying(),
_stationNum.ToUnderlying());
return GameActions::Result(
@@ -114,7 +114,7 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid ride id %u for entrance/exit removal", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid ride id %u for entrance/exit removal", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
}
@@ -137,7 +137,7 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const
}
else if (entranceElement == nullptr)
{
LOG_WARNING(
LOG_ERROR(
"Entrance element not found. x = %d, y = %d, ride = %u, station = %d", _loc.x, _loc.y, _rideIndex.ToUnderlying(),
_stationNum);
return GameActions::Result(

View File

@@ -34,13 +34,13 @@ GameActions::Result RideFreezeRatingAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
}
if (_value <= 0)
{
LOG_WARNING("Rating value must be positive", _rideIndex.ToUnderlying());
LOG_ERROR("Rating value must be positive", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}

View File

@@ -53,7 +53,7 @@ GameActions::Result RideSetAppearanceAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
}
@@ -64,7 +64,7 @@ GameActions::Result RideSetAppearanceAction::Query() const
case RideSetAppearanceType::TrackColourSupports:
if (_index >= std::size(ride->track_colour))
{
LOG_WARNING("Invalid game command, index %d out of bounds", _index);
LOG_ERROR("Invalid game command, index %d out of bounds", _index);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@@ -74,7 +74,7 @@ GameActions::Result RideSetAppearanceAction::Query() const
case RideSetAppearanceType::VehicleColourTertiary:
if (_index >= std::size(ride->vehicle_colours))
{
LOG_WARNING("Invalid game command, index %d out of bounds", _index);
LOG_ERROR("Invalid game command, index %d out of bounds", _index);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@@ -84,7 +84,7 @@ GameActions::Result RideSetAppearanceAction::Query() const
case RideSetAppearanceType::SellingItemColourIsRandom:
break;
default:
LOG_WARNING("Invalid game command, type %d not recognised", _type);
LOG_ERROR("Invalid game command, type %d not recognised", _type);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@@ -97,7 +97,7 @@ GameActions::Result RideSetAppearanceAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
}

View File

@@ -50,7 +50,7 @@ GameActions::Result RideSetNameAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE);
}
@@ -68,7 +68,7 @@ GameActions::Result RideSetNameAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE);
}

View File

@@ -54,14 +54,14 @@ GameActions::Result RideSetPriceAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
}
const auto* rideEntry = GetRideEntryByIndex(ride->subtype);
if (rideEntry == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND);
}
@@ -77,14 +77,14 @@ GameActions::Result RideSetPriceAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
}
const auto* rideEntry = GetRideEntryByIndex(ride->subtype);
if (rideEntry == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND);
}

View File

@@ -48,7 +48,7 @@ GameActions::Result RideSetSettingAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid ride: #%u.", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid ride: #%u.", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
}
@@ -69,7 +69,7 @@ GameActions::Result RideSetSettingAction::Query() const
if (!RideIsModeValid(*ride) && !GetGameState().Cheats.ShowAllOperatingModes)
{
LOG_WARNING("Invalid ride mode: %u", _value);
LOG_ERROR("Invalid ride mode: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
}
break;
@@ -78,21 +78,21 @@ GameActions::Result RideSetSettingAction::Query() const
case RideSetSetting::MinWaitingTime:
if (_value > 250)
{
LOG_WARNING("Invalid minimum waiting time: %u", _value);
LOG_ERROR("Invalid minimum waiting time: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
}
break;
case RideSetSetting::MaxWaitingTime:
if (_value > 250)
{
LOG_WARNING("Invalid maximum waiting time: %u", _value);
LOG_ERROR("Invalid maximum waiting time: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
}
break;
case RideSetSetting::Operation:
if (!RideIsValidOperationOption(*ride))
{
LOG_WARNING("Invalid operation option value: %u", _value);
LOG_ERROR("Invalid operation option value: %u", _value);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, GetOperationErrorMessage(*ride));
}
@@ -100,7 +100,7 @@ GameActions::Result RideSetSettingAction::Query() const
case RideSetSetting::InspectionInterval:
if (_value > RIDE_INSPECTION_NEVER)
{
LOG_WARNING("Invalid inspection interval: %u", _value);
LOG_ERROR("Invalid inspection interval: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
}
break;
@@ -112,7 +112,7 @@ GameActions::Result RideSetSettingAction::Query() const
auto musicObj = objManager.GetLoadedObject(ObjectType::Music, _value);
if (musicObj == nullptr)
{
LOG_WARNING("Invalid music style: %u", _value);
LOG_ERROR("Invalid music style: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
}
break;
@@ -120,7 +120,7 @@ GameActions::Result RideSetSettingAction::Query() const
case RideSetSetting::LiftHillSpeed:
if (!RideIsValidLiftHillSpeed(*ride))
{
LOG_WARNING("Invalid lift hill speed: %u", _value);
LOG_ERROR("Invalid lift hill speed: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
}
break;
@@ -134,19 +134,19 @@ GameActions::Result RideSetSettingAction::Query() const
if (!RideIsValidNumCircuits())
{
LOG_WARNING("Invalid number of circuits: %u", _value);
LOG_ERROR("Invalid number of circuits: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
}
break;
case RideSetSetting::RideType:
if (!GetGameState().Cheats.AllowArbitraryRideTypeChanges)
{
LOG_WARNING("Arbitrary ride type changes not allowed.");
LOG_ERROR("Arbitrary ride type changes not allowed.");
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
}
break;
default:
LOG_WARNING("Invalid RideSetSetting: %u", static_cast<uint8_t>(_setting));
LOG_ERROR("Invalid RideSetSetting: %u", static_cast<uint8_t>(_setting));
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
}
@@ -158,7 +158,7 @@ GameActions::Result RideSetSettingAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid ride: #%u.", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid ride: #%u.", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
}

View File

@@ -60,7 +60,7 @@ GameActions::Result RideSetStatusAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying());
res.Error = GameActions::Status::InvalidParameters;
res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
res.ErrorMessage = STR_NONE;
@@ -69,7 +69,7 @@ GameActions::Result RideSetStatusAction::Query() const
if (_status >= RideStatus::Count)
{
LOG_WARNING("Invalid ride status %u for ride %u", EnumValue(_status), _rideIndex.ToUnderlying());
LOG_ERROR("Invalid ride status %u for ride %u", EnumValue(_status), _rideIndex.ToUnderlying());
res.Error = GameActions::Status::InvalidParameters;
res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
res.ErrorMessage = STR_NONE;
@@ -124,7 +124,7 @@ GameActions::Result RideSetStatusAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying());
res.Error = GameActions::Status::InvalidParameters;
res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
res.ErrorMessage = STR_NONE;

View File

@@ -66,14 +66,14 @@ GameActions::Result RideSetVehicleAction::Query() const
{
if (_type >= RideSetVehicleType::Count)
{
LOG_WARNING("Invalid type. type = %d", _type);
LOG_ERROR("Invalid type. type = %d", _type);
}
auto errTitle = SetVehicleTypeErrorTitle[EnumValue(_type)];
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
}
@@ -103,7 +103,7 @@ GameActions::Result RideSetVehicleAction::Query() const
auto rideEntry = GetRideEntryByIndex(_value);
if (rideEntry == nullptr)
{
LOG_WARNING("Invalid ride entry, ride->subtype = %d", ride->subtype);
LOG_ERROR("Invalid ride entry, ride->subtype = %d", ride->subtype);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
}
@@ -131,7 +131,7 @@ GameActions::Result RideSetVehicleAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
}
@@ -154,7 +154,7 @@ GameActions::Result RideSetVehicleAction::Execute() const
auto rideEntry = GetRideEntryByIndex(ride->subtype);
if (rideEntry == nullptr)
{
LOG_WARNING("Invalid ride entry, ride->subtype = %d", ride->subtype);
LOG_ERROR("Invalid ride entry, ride->subtype = %d", ride->subtype);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
}
uint8_t clampValue = _value;
@@ -177,7 +177,7 @@ GameActions::Result RideSetVehicleAction::Execute() const
auto rideEntry = GetRideEntryByIndex(ride->subtype);
if (rideEntry == nullptr)
{
LOG_WARNING("Invalid ride entry, ride->subtype = %d", ride->subtype);
LOG_ERROR("Invalid ride entry, ride->subtype = %d", ride->subtype);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
}

View File

@@ -48,7 +48,7 @@ GameActions::Result SignSetNameAction::Query() const
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
LOG_WARNING("Invalid game command for setting sign name, banner id = %d", _bannerIndex);
LOG_ERROR("Invalid game command for setting sign name, banner id = %d", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE);
}
return GameActions::Result();
@@ -59,7 +59,7 @@ GameActions::Result SignSetNameAction::Execute() const
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
LOG_WARNING("Invalid game command for setting sign name, banner id = %d", _bannerIndex);
LOG_ERROR("Invalid game command for setting sign name, banner id = %d", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE);
}

View File

@@ -59,12 +59,12 @@ GameActions::Result SignSetStyleAction::Query() const
TileElement* tileElement = BannerGetTileElement(_bannerIndex);
if (tileElement == nullptr)
{
LOG_WARNING("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex);
LOG_ERROR("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
}
if (tileElement->GetType() != TileElementType::LargeScenery)
{
LOG_WARNING("Invalid game command for setting sign style, banner id '%d' is not large", _bannerIndex);
LOG_ERROR("Invalid game command for setting sign style, banner id '%d' is not large", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
}
}
@@ -74,7 +74,7 @@ GameActions::Result SignSetStyleAction::Query() const
if (wallElement == nullptr)
{
LOG_WARNING("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex);
LOG_ERROR("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
}
}

View File

@@ -71,14 +71,14 @@ GameActions::Result StaffSetCostumeAction::Query() const
auto* staff = TryGetEntity<Staff>(_spriteIndex);
if (staff == nullptr)
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
LOG_ERROR("Invalid game command for sprite %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
}
auto spriteType = EntertainerCostumeToSprite(_costume);
if (EnumValue(spriteType) > std::size(peep_slow_walking_types))
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
LOG_ERROR("Invalid game command for sprite %u", _spriteIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@@ -90,7 +90,7 @@ GameActions::Result StaffSetCostumeAction::Execute() const
auto* staff = TryGetEntity<Staff>(_spriteIndex);
if (staff == nullptr)
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
LOG_ERROR("Invalid game command for sprite %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
}

View File

@@ -55,7 +55,7 @@ GameActions::Result StaffSetNameAction::Query() const
auto staff = TryGetEntity<Staff>(_spriteIndex);
if (staff == nullptr)
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
LOG_ERROR("Invalid game command for sprite %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE);
}
@@ -67,7 +67,7 @@ GameActions::Result StaffSetNameAction::Execute() const
auto staff = TryGetEntity<Staff>(_spriteIndex);
if (staff == nullptr)
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
LOG_ERROR("Invalid game command for sprite %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE);
}

View File

@@ -53,7 +53,7 @@ GameActions::Result StaffSetOrdersAction::Query() const
if (staff == nullptr
|| (staff->AssignedStaffType != StaffType::Handyman && staff->AssignedStaffType != StaffType::Mechanic))
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
LOG_ERROR("Invalid game command for sprite %u", _spriteIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE);
}
@@ -66,7 +66,7 @@ GameActions::Result StaffSetOrdersAction::Execute() const
auto* staff = TryGetEntity<Staff>(_spriteIndex);
if (staff == nullptr)
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
LOG_ERROR("Invalid game command for sprite %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
}
staff->StaffOrders = _ordersId;

View File

@@ -90,7 +90,7 @@ GameActions::Result TrackDesignAction::Query() const
auto ride = GetRide(rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for track placement, ride id = %d", rideIndex);
LOG_ERROR("Invalid game command for track placement, ride id = %d", rideIndex);
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
}
@@ -163,7 +163,7 @@ GameActions::Result TrackDesignAction::Execute() const
auto ride = GetRide(rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for track placement, ride id = %d", rideIndex);
LOG_ERROR("Invalid game command for track placement, ride id = %d", rideIndex);
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
}

View File

@@ -72,21 +72,21 @@ GameActions::Result TrackPlaceAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
}
const auto* rideEntry = GetRideEntryByIndex(ride->subtype);
if (rideEntry == nullptr)
{
LOG_WARNING("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
}
if (!DirectionValid(_origin.direction))
{
LOG_WARNING("Invalid direction for track placement, direction = %d", _origin.direction);
LOG_ERROR("Invalid direction for track placement, direction = %d", _origin.direction);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
}
@@ -99,7 +99,7 @@ GameActions::Result TrackPlaceAction::Query() const
if (_rideType > RIDE_TYPE_COUNT)
{
LOG_WARNING("Invalid ride type for track placement, rideType = %d", _rideType);
LOG_ERROR("Invalid ride type for track placement, rideType = %d", _rideType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
}
@@ -189,7 +189,7 @@ GameActions::Result TrackPlaceAction::Query() const
if (!CheckMapCapacity(numElements))
{
LOG_WARNING("Not enough free map elements to place track.");
LOG_ERROR("Not enough free map elements to place track.");
return GameActions::Result(
GameActions::Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
STR_TILE_ELEMENT_LIMIT_REACHED);
@@ -413,7 +413,7 @@ GameActions::Result TrackPlaceAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
}
@@ -421,7 +421,7 @@ GameActions::Result TrackPlaceAction::Execute() const
const auto* rideEntry = GetRideEntryByIndex(ride->subtype);
if (rideEntry == nullptr)
{
LOG_WARNING("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
LOG_ERROR("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
}
@@ -558,7 +558,7 @@ GameActions::Result TrackPlaceAction::Execute() const
auto* trackElement = TileElementInsert<TrackElement>(mapLoc, quarterTile.GetBaseQuarterOccupied());
if (trackElement == nullptr)
{
LOG_WARNING("Cannot create track element for ride = %d", _rideIndex.ToUnderlying());
LOG_ERROR("Cannot create track element for ride = %d", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
STR_TILE_ELEMENT_LIMIT_REACHED);

View File

@@ -110,7 +110,7 @@ GameActions::Result TrackRemoveAction::Query() const
if (!found)
{
LOG_WARNING(
LOG_ERROR(
"Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", _origin.x, _origin.y, _origin.z,
_origin.direction, _sequence);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
@@ -129,13 +129,13 @@ GameActions::Result TrackRemoveAction::Query() const
auto ride = GetRide(rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Ride not found. ride index = %d.", rideIndex);
LOG_ERROR("Ride not found. ride index = %d.", rideIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
}
if (ride->type >= RIDE_TYPE_COUNT)
{
LOG_WARNING("Ride type not found. ride type = %d.", ride->type);
LOG_ERROR("Ride type not found. ride type = %d.", ride->type);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
}
const auto& ted = GetTrackElementDescriptor(trackType);
@@ -143,7 +143,7 @@ GameActions::Result TrackRemoveAction::Query() const
const PreviewTrack* trackBlock = ted.GetBlockForSequence(sequenceIndex);
if (trackBlock == nullptr)
{
LOG_WARNING("Track block %d not found for track type %d.", sequenceIndex, trackType);
LOG_ERROR("Track block %d not found for track type %d.", sequenceIndex, trackType);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
}
@@ -204,7 +204,7 @@ GameActions::Result TrackRemoveAction::Query() const
if (!found)
{
LOG_WARNING(
LOG_ERROR(
"Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", mapLoc.x, mapLoc.y, mapLoc.z,
_origin.direction, trackBlock->index);
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
@@ -224,7 +224,7 @@ GameActions::Result TrackRemoveAction::Query() const
auto* surfaceElement = MapGetSurfaceElementAt(mapLoc);
if (surfaceElement == nullptr)
{
LOG_WARNING("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y);
LOG_ERROR("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y);
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
}
@@ -311,7 +311,7 @@ GameActions::Result TrackRemoveAction::Execute() const
if (!found)
{
LOG_WARNING(
LOG_ERROR(
"Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", _origin.x, _origin.y, _origin.z,
_origin.direction, _sequence);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
@@ -324,7 +324,7 @@ GameActions::Result TrackRemoveAction::Execute() const
auto ride = GetRide(rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Ride not found. ride index = %d.", rideIndex);
LOG_ERROR("Ride not found. ride index = %d.", rideIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
}
const auto& ted = GetTrackElementDescriptor(trackType);
@@ -332,7 +332,7 @@ GameActions::Result TrackRemoveAction::Execute() const
const PreviewTrack* trackBlock = ted.GetBlockForSequence(sequenceIndex);
if (trackBlock == nullptr)
{
LOG_WARNING("Track block %d not found for track type %d.", sequenceIndex, trackType);
LOG_ERROR("Track block %d not found for track type %d.", sequenceIndex, trackType);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
}
@@ -388,7 +388,7 @@ GameActions::Result TrackRemoveAction::Execute() const
if (!found)
{
LOG_WARNING(
LOG_ERROR(
"Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", mapLoc.x, mapLoc.y, mapLoc.z,
_origin.direction, trackBlock->index);
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
@@ -408,7 +408,7 @@ GameActions::Result TrackRemoveAction::Execute() const
auto* surfaceElement = MapGetSurfaceElementAt(mapLoc);
if (surfaceElement == nullptr)
{
LOG_WARNING("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y);
LOG_ERROR("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y);
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
}

View File

@@ -63,7 +63,7 @@ GameActions::Result TrackSetBrakeSpeedAction::QueryExecute(bool isExecuting) con
TileElement* tileElement = MapGetTrackElementAtOfType(_loc, _trackType);
if (tileElement == nullptr)
{
LOG_WARNING("Invalid game command for setting brakes speed. x = %d, y = %d", _loc.x, _loc.y);
LOG_ERROR("Invalid game command for setting brakes speed. x = %d, y = %d", _loc.x, _loc.y);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND);
}