Merge pull request #21581 from pfroud/cleanup-error-logging

Cleanup error logging
This commit is contained in:
Michael Steenbeek 2024-03-30 18:08:12 +01:00 committed by GitHub
commit 27e43b3a94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
68 changed files with 427 additions and 294 deletions

View File

@ -3696,6 +3696,7 @@ STR_6621 :Restrict
STR_6622 :Restrict object to the Scenario Editor and Sandbox mode.
STR_6623 :Type help for a list of available commands. Type hide to hide the console.
STR_6624 :Tile Inspector: Sort elements
STR_6625 :Invalid colour
#############
# Scenarios #

View File

@ -39,7 +39,7 @@ GameActions::Result BalloonPressAction::Query() const
auto balloon = TryGetEntity<Balloon>(_spriteIndex);
if (balloon == nullptr)
{
LOG_ERROR("Tried getting invalid sprite for balloon: %u", _spriteIndex);
LOG_ERROR("Balloon not found for spriteIndex %u", _spriteIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND);
}
@ -51,7 +51,7 @@ GameActions::Result BalloonPressAction::Execute() const
auto balloon = TryGetEntity<Balloon>(_spriteIndex);
if (balloon == nullptr)
{
LOG_ERROR("Tried getting invalid sprite for balloon: %u", _spriteIndex);
LOG_ERROR("Balloon not found for spriteIndex %u", _spriteIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND);
}

View File

@ -98,9 +98,9 @@ GameActions::Result BannerPlaceAction::Query() const
auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry<BannerSceneryEntry>(_bannerType);
if (bannerEntry == nullptr)
{
LOG_ERROR("Invalid banner object type. bannerType = ", _bannerType);
LOG_ERROR("Banner entry not found for bannerType %u", _bannerType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
}
res.Cost = bannerEntry->price;
@ -126,9 +126,9 @@ GameActions::Result BannerPlaceAction::Execute() const
auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry<BannerSceneryEntry>(_bannerType);
if (bannerEntry == nullptr)
{
LOG_ERROR("Invalid banner object type. bannerType = ", _bannerType);
LOG_ERROR("Banner entry not found for bannerType %u", _bannerType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
}
auto banner = CreateBanner();

View File

@ -70,14 +70,14 @@ GameActions::Result BannerRemoveAction::Query() const
auto bannerIndex = bannerElement->GetIndex();
if (bannerIndex == BannerIndex::GetNull())
{
LOG_ERROR("Invalid banner index. index = ", bannerIndex);
LOG_ERROR("Invalid banner index %u", bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
}
auto banner = bannerElement->GetBanner();
if (banner == nullptr)
{
LOG_ERROR("Invalid banner index. index = ", bannerIndex);
LOG_ERROR("Invalid banner index %u", bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
}
@ -109,14 +109,14 @@ GameActions::Result BannerRemoveAction::Execute() const
auto bannerIndex = bannerElement->GetIndex();
if (bannerIndex == BannerIndex::GetNull())
{
LOG_ERROR("Invalid banner index. index = ", bannerIndex);
LOG_ERROR("Invalid banner index %u", bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
}
auto banner = bannerElement->GetBanner();
if (banner == nullptr)
{
LOG_ERROR("Invalid banner index. index = ", bannerIndex);
LOG_ERROR("Invalid banner index %u", bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
}

View File

@ -66,8 +66,8 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const
if (_primaryColour > 31)
{
LOG_ERROR("Invalid primary colour: colour = %u", _primaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
LOG_ERROR("Invalid primary colour %u", _primaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
}
if (!MapCanBuildAt({ _loc.x, _loc.y, _loc.z - 16 }))
@ -79,15 +79,15 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const
if (bannerElement == nullptr)
{
LOG_ERROR("Could not find banner 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);
LOG_ERROR("No banner 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_ERR_BANNER_ELEMENT_NOT_FOUND);
}
auto index = bannerElement->GetIndex();
auto banner = GetBanner(index);
if (banner == nullptr)
{
LOG_ERROR("Invalid banner index: index = %u", index);
LOG_ERROR("Invalid banner index %u", index);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
}

View File

@ -47,8 +47,9 @@ GameActions::Result BannerSetNameAction::Query() const
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
LOG_WARNING("Invalid banner id, banner id = %d", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE);
LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
}
return GameActions::Result();
}
@ -58,8 +59,9 @@ GameActions::Result BannerSetNameAction::Execute() const
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
LOG_WARNING("Invalid banner id, banner id = %d", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE);
LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
}
banner->text = _name;

View File

@ -49,8 +49,9 @@ GameActions::Result BannerSetStyleAction::Query() const
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
LOG_ERROR("Invalid banner index: index = %u", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
}
res.Expenditure = ExpenditureType::Landscaping;
@ -61,8 +62,9 @@ GameActions::Result BannerSetStyleAction::Query() const
if (tileElement == nullptr)
{
LOG_ERROR("Could not find banner index = %u", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
LOG_ERROR("Banner tile element not found for bannerIndex %d", _bannerIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
}
switch (_type)
@ -70,16 +72,18 @@ GameActions::Result BannerSetStyleAction::Query() const
case BannerSetStyleType::PrimaryColour:
if (_parameter > COLOUR_COUNT)
{
LOG_ERROR("Invalid primary colour: colour = %u", _parameter);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
LOG_ERROR("Invalid primary colour %u", _parameter);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
}
break;
case BannerSetStyleType::TextColour:
if (_parameter > 13)
{
LOG_ERROR("Invalid text colour: colour = %u", _parameter);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
LOG_ERROR("Invalid text colour %u", _parameter);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
}
break;
case BannerSetStyleType::NoEntry:
@ -90,8 +94,9 @@ GameActions::Result BannerSetStyleAction::Query() const
}
break;
default:
LOG_ERROR("Invalid type: %u", _type);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
LOG_ERROR("Invalid banner style type %u", _type);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
}
return res;
}
@ -103,8 +108,9 @@ GameActions::Result BannerSetStyleAction::Execute() const
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
LOG_ERROR("Invalid banner index: index = %u", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
}
res.Expenditure = ExpenditureType::Landscaping;
@ -115,7 +121,7 @@ GameActions::Result BannerSetStyleAction::Execute() const
if (tileElement == nullptr)
{
LOG_ERROR("Could not find banner index = %u", _bannerIndex);
LOG_ERROR("Banner tile element not found for bannerIndex &u", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
}
@ -133,7 +139,8 @@ GameActions::Result BannerSetStyleAction::Execute() const
if (bannerElement == nullptr)
{
LOG_ERROR("Tile element was not a banner.");
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE);
return GameActions::Result(
GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
}
banner->flags &= ~BANNER_FLAG_NO_ENTRY;
@ -147,8 +154,9 @@ GameActions::Result BannerSetStyleAction::Execute() const
break;
}
default:
LOG_ERROR("Invalid type: %u", _type);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
LOG_ERROR("Invalid banner style type %u", _type);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
}
auto intent = Intent(INTENT_ACTION_UPDATE_BANNER);

View File

@ -72,6 +72,7 @@ GameActions::Result CheatSetAction::Query() const
{
if (static_cast<uint32_t>(_cheatType) >= static_cast<uint32_t>(CheatType::Count))
{
LOG_ERROR("Invalid cheat type %u", _cheatType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@ -80,11 +81,17 @@ GameActions::Result CheatSetAction::Query() const
if (_param1 < validRange.first.first || _param1 > validRange.first.second)
{
LOG_ERROR(
"The first cheat parameter is out of range. Value = %d, min = %d, max = %d", _param1, validRange.first.first,
validRange.first.second);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
if (_param2 < validRange.second.first || _param2 > validRange.second.second)
{
LOG_ERROR(
"The second cheat parameter is out of range. Value = %d, min = %d, max = %d", _param2, validRange.second.first,
validRange.second.second);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@ -259,7 +266,7 @@ GameActions::Result CheatSetAction::Execute() const
break;
default:
{
LOG_ERROR("Unabled cheat: %d", _cheatType.id);
LOG_ERROR("Invalid cheat type %d", _cheatType.id);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}

View File

@ -37,7 +37,8 @@ GameActions::Result ClimateSetAction::Query() const
{
if (_climate >= ClimateType::Count)
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_INVALID_CLIMATE_ID, STR_NONE);
LOG_ERROR("Invalid climate type %u", _climate);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_INVALID_CLIMATE_ID, STR_ERR_VALUE_OUT_OF_RANGE);
}
return GameActions::Result();

View File

@ -77,8 +77,9 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const
auto tileElement = MapGetFootpathElement(_loc);
if (tileElement == nullptr)
{
LOG_ERROR("Could not find path element.");
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND);
}
auto pathElement = tileElement->AsPath();
@ -99,6 +100,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const
auto* pathAdditionEntry = OpenRCT2::ObjectManager::GetObjectEntry<PathAdditionEntry>(_entryIndex);
if (pathAdditionEntry == nullptr)
{
LOG_ERROR("Unknown footpath addition entry for entryIndex %d", _entryIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
}
@ -153,8 +155,9 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const
if (pathElement == nullptr)
{
LOG_ERROR("Could not find path element.");
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND);
}
// No change
@ -167,6 +170,7 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const
auto* pathAdditionEntry = OpenRCT2::ObjectManager::GetObjectEntry<PathAdditionEntry>(_entryIndex);
if (pathAdditionEntry == nullptr)
{
LOG_ERROR("Unknown footpath addition entry for entryIndex %d", _entryIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
}

View File

@ -69,15 +69,17 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const
auto tileElement = MapGetFootpathElement(_loc);
if (tileElement == nullptr)
{
LOG_WARNING("Could not find path element.");
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND);
}
auto pathElement = tileElement->AsPath();
if (pathElement == nullptr)
{
LOG_WARNING("Could not find path element.");
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND);
}
if (!pathElement->AdditionIsGhost() && (GetFlags() & GAME_COMMAND_FLAG_GHOST))
@ -101,8 +103,9 @@ GameActions::Result FootpathAdditionRemoveAction::Execute() const
if (pathElement == nullptr)
{
LOG_ERROR("Could not find path element.");
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND);
}
pathElement->SetAddition(0);

View File

@ -177,7 +177,8 @@ GameActions::Result FootpathLayoutPlaceAction::ElementInsertQuery(GameActions::R
if (surfaceElement == nullptr)
{
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_SURFACE_ELEMENT_NOT_FOUND);
}
int32_t supportHeight = zLow - surfaceElement->GetBaseZ();
res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / PATH_HEIGHT_STEP) * 5.00_GBP;
@ -241,7 +242,8 @@ GameActions::Result FootpathLayoutPlaceAction::ElementInsertExecute(GameActions:
if (surfaceElement == nullptr)
{
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_SURFACE_ELEMENT_NOT_FOUND);
}
int32_t supportHeight = zLow - surfaceElement->GetBaseZ();
res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / PATH_HEIGHT_STEP) * 5.00_GBP;

View File

@ -101,7 +101,8 @@ GameActions::Result FootpathPlaceAction::Query() const
if (_direction != INVALID_DIRECTION && !DirectionValid(_direction))
{
LOG_ERROR("Direction invalid. direction = %u", _direction);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
}
FootpathProvisionalRemove();
@ -323,7 +324,8 @@ GameActions::Result FootpathPlaceAction::ElementInsertQuery(GameActions::Result
auto surfaceElement = MapGetSurfaceElementAt(_loc);
if (surfaceElement == nullptr)
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
int32_t supportHeight = zLow - surfaceElement->GetBaseZ();
res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / PATH_HEIGHT_STEP) * 5.00_GBP;
@ -386,7 +388,8 @@ GameActions::Result FootpathPlaceAction::ElementInsertExecute(GameActions::Resul
auto surfaceElement = MapGetSurfaceElementAt(_loc);
if (surfaceElement == nullptr)
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
int32_t supportHeight = zLow - surfaceElement->GetBaseZ();
res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / PATH_HEIGHT_STEP) * 5.00_GBP;

View File

@ -68,7 +68,8 @@ GameActions::Result FootpathRemoveAction::Query() const
TileElement* footpathElement = GetFootpathElement();
if (footpathElement == nullptr)
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND);
}
res.Cost = GetRefundPrice(footpathElement);

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 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 speed %u", _speed);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}

View File

@ -42,7 +42,7 @@ GameActions::Result GuestSetFlagsAction::Query() const
auto* peep = TryGetEntity<Guest>(_peepId);
if (peep == nullptr)
{
LOG_ERROR("Used invalid sprite index for peep: %u", _peepId.ToUnderlying());
LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_NONE);
}
return GameActions::Result();
@ -53,7 +53,7 @@ GameActions::Result GuestSetFlagsAction::Execute() const
auto* peep = TryGetEntity<Guest>(_peepId);
if (peep == nullptr)
{
LOG_ERROR("Used invalid sprite index for peep: %u", _peepId.ToUnderlying());
LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_NONE);
}

View File

@ -58,13 +58,13 @@ GameActions::Result GuestSetNameAction::Query() const
{
if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull())
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_ERR_VALUE_OUT_OF_RANGE);
}
auto guest = TryGetEntity<Guest>(_spriteIndex);
if (guest == nullptr)
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
LOG_ERROR("Guest entity not found for spriteIndex %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("Guest entity not found for spriteIndex %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE);
}

View File

@ -113,15 +113,16 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY&
{
if (_setting >= LandBuyRightSetting::Count)
{
LOG_WARNING("Tried calling buy land rights with an incorrect setting. setting = %u", _setting);
return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE);
LOG_ERROR("Invalid land buying setting %u", _setting);
return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE);
}
SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc);
if (surfaceElement == nullptr)
{
LOG_ERROR("Could not find surface. x = %d, y = %d", loc.x, loc.y);
return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[EnumValue(_setting)], STR_NONE);
LOG_ERROR("No surface at x = %d, y = %d", loc.x, loc.y);
return GameActions::Result(
GameActions::Status::InvalidParameters, _ErrorTitles[EnumValue(_setting)], STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
auto res = GameActions::Result();
@ -170,7 +171,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY&
return res;
default:
LOG_WARNING("Tried calling buy land rights with an incorrect setting. setting = %u", _setting);
return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE);
LOG_ERROR("Invalid land buying setting %u", _setting);
return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE);
}
}

View File

@ -116,7 +116,7 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY&
SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc);
if (surfaceElement == nullptr)
{
LOG_ERROR("Could not find surface. x = %d, y = %d", loc.x, loc.y);
LOG_ERROR("No surface at x = %d, y = %d", loc.x, loc.y);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
@ -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("Invalid setting %u to set land rights", _setting);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}

View File

@ -607,8 +607,9 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const
break;
}
default:
LOG_ERROR("Invalid map selection %u", _selectionType);
return GameActions::Result(GameActions::Status::InvalidParameters, std::get<StringId>(res.ErrorTitle), STR_NONE);
LOG_ERROR("Invalid map selection type %u", _selectionType);
return GameActions::Result(
GameActions::Status::InvalidParameters, std::get<StringId>(res.ErrorTitle), STR_ERR_VALUE_OUT_OF_RANGE);
} // switch selectionType
// Raise / lower the land tool selection area

View File

@ -70,24 +70,32 @@ GameActions::Result LargeSceneryPlaceAction::Query() const
money64 supportsCost = 0;
if (_primaryColour >= COLOUR_COUNT || _secondaryColour >= COLOUR_COUNT || _tertiaryColour >= COLOUR_COUNT)
if (_primaryColour >= COLOUR_COUNT)
{
LOG_ERROR(
"Invalid game command for scenery placement, primaryColour = %u, secondaryColour = %u", _primaryColour,
_secondaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
LOG_ERROR("Invalid primary colour %u", _primaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR);
}
if (_sceneryType >= MAX_LARGE_SCENERY_OBJECTS)
else if (_secondaryColour >= COLOUR_COUNT)
{
LOG_ERROR("Invalid game command for scenery placement, sceneryType = %u", _sceneryType);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
LOG_ERROR("Invalid secondary colour %u", _secondaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR);
}
else if (_tertiaryColour >= COLOUR_COUNT)
{
LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR);
}
else if (_sceneryType >= MAX_LARGE_SCENERY_OBJECTS)
{
LOG_ERROR("Invalid sceneryType %u", _sceneryType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
}
auto* sceneryEntry = ObjectManager::GetObjectEntry<LargeSceneryEntry>(_sceneryType);
if (sceneryEntry == nullptr)
{
LOG_ERROR("Invalid game command for scenery placement, sceneryType = %u", _sceneryType);
LOG_ERROR("Large scenery entry not found for sceneryType %u", _sceneryType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
}
@ -201,7 +209,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const
auto* sceneryEntry = ObjectManager::GetObjectEntry<LargeSceneryEntry>(_sceneryType);
if (sceneryEntry == nullptr)
{
LOG_ERROR("Invalid game command for scenery placement, sceneryType = %u", _sceneryType);
LOG_ERROR("Large scenery entry not found for sceneryType = %u", _sceneryType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
}

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("No large scenery element to remove at x = %d, y = %d", _loc.x, _loc.y);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
}
@ -73,7 +73,10 @@ GameActions::Result LargeSceneryRemoveAction::Query() const
auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry();
// If we have a bugged scenery entry, do not touch the tile element.
if (sceneryEntry == nullptr)
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS, STR_UNKNOWN_OBJECT_TYPE);
{
LOG_WARNING("Scenery entry at x = %d, y = %d not removed because it is an unknown object type", _loc.x, _loc.y);
}
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS, STR_UNKNOWN_OBJECT_TYPE);
auto rotatedOffsets = CoordsXYZ{
CoordsXY{ sceneryEntry->tiles[_tileIndex].x_offset, sceneryEntry->tiles[_tileIndex].y_offset }.Rotate(_loc.direction),
@ -147,7 +150,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("No large scenery element to remove at %d, y = %d", _loc.x, _loc.y);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
}
@ -155,7 +158,10 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const
auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry();
// If we have a bugged scenery entry, do not touch the tile element.
if (sceneryEntry == nullptr)
{
LOG_WARNING("Scenery entry at x = %d, y = %d not removed because it is an unknown object type", _loc.x, _loc.y);
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS, STR_NONE);
}
tileElement->RemoveBannerEntry();
@ -184,14 +190,14 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const
}
auto* sceneryElement = FindLargeSceneryElement(currentTile, i);
if (sceneryElement != nullptr)
if (sceneryElement == nullptr)
{
MapInvalidateTileFull(currentTile);
TileElementRemove(sceneryElement);
LOG_ERROR("Tile not found when trying to remove element!");
}
else
{
LOG_ERROR("Tile not found when trying to remove element!");
MapInvalidateTileFull(currentTile);
TileElementRemove(sceneryElement);
}
}

View File

@ -70,25 +70,23 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting)
if (_loc.x < 0 || _loc.y < 0 || _loc.x > mapSizeMax.x || _loc.y > mapSizeMax.y)
{
LOG_ERROR("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
}
if (_primaryColour >= COLOUR_COUNT)
{
LOG_ERROR("Invalid primary colour: colour = %u", _primaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
LOG_ERROR("Invalid primary colour %u", _primaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
}
if (_secondaryColour >= COLOUR_COUNT)
else if (_secondaryColour >= COLOUR_COUNT)
{
LOG_ERROR("Invalid secondary colour: colour = %u", _secondaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
LOG_ERROR("Invalid secondary colour %u", _secondaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
}
if (_tertiaryColour >= COLOUR_COUNT)
else if (_tertiaryColour >= COLOUR_COUNT)
{
LOG_ERROR("Invalid tertiary colour: colour = %u", _tertiaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
}
auto largeElement = MapGetLargeScenerySegment(_loc, _tileIndex);
@ -110,7 +108,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting)
if (sceneryEntry == nullptr)
{
LOG_ERROR("Could not find scenery object. type = %u", largeElement->GetEntryIndex());
LOG_ERROR("Scenery element doesn't have scenery entry");
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE);
}
// Work out the base tile coordinates (Tile with index 0)

View File

@ -37,11 +37,13 @@ GameActions::Result MapChangeSizeAction::Query() const
{
if (_targetSize.x > kMaximumMapSizeTechnical || _targetSize.y > kMaximumMapSizeTechnical)
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE);
}
if (_targetSize.x < kMinimumMapSizeTechnical || _targetSize.y < kMinimumMapSizeTechnical)
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE);
}
return GameActions::Result();
}

View File

@ -122,8 +122,9 @@ GameActions::Result MazePlaceTrackAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr || ride->type == RIDE_TYPE_NULL)
{
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex);
res.Error = GameActions::Status::InvalidParameters;
res.ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS;
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
return res;
}
@ -143,8 +144,9 @@ GameActions::Result MazePlaceTrackAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex);
res.Error = GameActions::Status::InvalidParameters;
res.ErrorMessage = STR_NONE;
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
return res;
}

View File

@ -168,8 +168,9 @@ GameActions::Result MazeSetTrackAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr || ride->type == RIDE_CRASH_TYPE_NONE)
{
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex);
res.Error = GameActions::Status::NoClearance;
res.ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS;
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
return res;
}
@ -192,8 +193,9 @@ GameActions::Result MazeSetTrackAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex);
res.Error = GameActions::Status::InvalidParameters;
res.ErrorMessage = STR_NONE;
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
return res;
}
@ -286,7 +288,7 @@ GameActions::Result MazeSetTrackAction::Execute() const
{
LOG_ERROR("No surface found");
res.Error = GameActions::Status::Unknown;
res.ErrorMessage = STR_NONE;
res.ErrorMessage = STR_ERR_SURFACE_ELEMENT_NOT_FOUND;
return res;
}

View File

@ -57,7 +57,7 @@ GameActions::Result ParkEntranceRemoveAction::Query() const
}
if (ParkEntranceGetIndex(_loc) == -1)
{
LOG_ERROR("Could not find entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
LOG_ERROR("No park entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
}
return res;
@ -73,7 +73,7 @@ GameActions::Result ParkEntranceRemoveAction::Execute() const
auto entranceIndex = ParkEntranceGetIndex(_loc);
if (entranceIndex == -1)
{
LOG_ERROR("Could not find entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
LOG_ERROR("No park entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
}

View File

@ -53,7 +53,8 @@ GameActions::Result ParkMarketingAction::Query() const
{
if (static_cast<size_t>(_type) >= std::size(AdvertisingCampaignPricePerWeek) || _numWeeks >= 256)
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_START_MARKETING_CAMPAIGN, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_START_MARKETING_CAMPAIGN, STR_ERR_VALUE_OUT_OF_RANGE);
}
if (GetGameState().ParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN)
{

View File

@ -45,8 +45,21 @@ void ParkSetDateAction::Serialise(DataSerialiser& stream)
GameActions::Result ParkSetDateAction::Query() const
{
if (_year < 0 || _year >= kMaxYear || _month < 0 || _month >= MONTH_COUNT || _day < 0 || _day >= 31)
if (_year < 0 || _year >= kMaxYear)
{
LOG_ERROR("Invalid park date year %d", _year);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
else if (_month < 0 || _month >= MONTH_COUNT)
{
LOG_ERROR("Invalid park date month %d", _year);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
else if (_day < 0 || _day >= 31)
{
LOG_ERROR("Invalid park date day %d", _year);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}

View File

@ -42,17 +42,23 @@ void ParkSetEntranceFeeAction::Serialise(DataSerialiser& stream)
GameActions::Result ParkSetEntranceFeeAction::Query() const
{
bool noMoney = (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) != 0;
bool forceFreeEntry = !ParkEntranceFeeUnlocked();
if (noMoney || forceFreeEntry)
if ((GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) != 0)
{
LOG_ERROR("Can't set park entrance fee because the park has no money");
return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, STR_NONE);
}
if (_fee < 0.00_GBP || _fee > MAX_ENTRANCE_FEE)
else if (!ParkEntranceFeeUnlocked())
{
LOG_ERROR("Park entrance fee is locked");
return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, STR_NONE);
}
else if (_fee < 0.00_GBP || _fee > MAX_ENTRANCE_FEE)
{
LOG_ERROR("Invalid park entrance fee %d", _fee);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
return GameActions::Result();
}

View File

@ -47,6 +47,7 @@ GameActions::Result ParkSetNameAction::Query() const
{
if (_name.empty())
{
LOG_ERROR("Can't set park name to empty string");
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_PARK, STR_INVALID_NAME_FOR_PARK);
}
return GameActions::Result();

View File

@ -44,6 +44,7 @@ GameActions::Result ParkSetParameterAction::Query() const
{
if (_parameter >= ParkParameter::Count)
{
LOG_ERROR("Invalid park parameter %d", _parameter);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@ -77,6 +78,7 @@ GameActions::Result ParkSetParameterAction::Execute() const
WindowInvalidateByClass(WindowClass::Ride);
break;
default:
LOG_ERROR("Invalid park parameter %d", _parameter);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}

View File

@ -47,6 +47,7 @@ GameActions::Result ParkSetResearchFundingAction::Query() const
{
if (_fundingAmount >= RESEARCH_FUNDING_COUNT)
{
LOG_ERROR("Invalid research funding amount %d", _fundingAmount);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}

View File

@ -106,7 +106,7 @@ GameActions::Result PeepPickupAction::Query() const
}
break;
default:
LOG_ERROR("Invalid pickup type: %u", _type);
LOG_ERROR("Invalid peep pickup type %u", _type);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE);
}
return res;
@ -175,7 +175,7 @@ GameActions::Result PeepPickupAction::Execute() const
CancelConcurrentPickups(peep);
break;
default:
LOG_ERROR("Invalid pickup type: %u", _type);
LOG_ERROR("Invalid peep pickup type %u", _type);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE);
}
return res;

View File

@ -74,7 +74,8 @@ GameActions::Result PeepSpawnPlaceAction::Query() const
auto surfaceMapElement = MapGetSurfaceElementAt(_location);
if (surfaceMapElement == nullptr)
{
return GameActions::Result(GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_NONE);
return GameActions::Result(
GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
if (surfaceMapElement->GetOwnership() != OWNERSHIP_UNOWNED)
{

View File

@ -83,6 +83,7 @@ GameActions::Result RideCreateAction::Query() const
if (_rideType >= RIDE_TYPE_COUNT)
{
LOG_ERROR("Invalid ride type %d", _rideType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE);
}
@ -90,6 +91,7 @@ GameActions::Result RideCreateAction::Query() const
int32_t rideEntryIndex = RideGetEntryIndex(_rideType, _subType);
if (rideEntryIndex >= MAX_RIDE_OBJECTS)
{
LOG_ERROR("Ride entry not found for rideType %d, subType %d", _rideType, _subType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE);
}
@ -97,12 +99,15 @@ GameActions::Result RideCreateAction::Query() const
const auto& colourPresets = GetRideTypeDescriptor(_rideType).ColourPresets;
if (_colour1 >= colourPresets.count)
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE);
LOG_ERROR("Can't create ride, invalid colour preset %d", _colour1);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_ERR_INVALID_COLOUR);
}
const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex);
if (rideEntry == nullptr)
{
LOG_ERROR("Ride entry not found for rideEntryIndex %d", rideEntryIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE);
}
@ -130,7 +135,9 @@ GameActions::Result RideCreateAction::Execute() const
const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex);
if (rideEntry == nullptr)
{
LOG_WARNING("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);
}

View File

@ -60,8 +60,8 @@ GameActions::Result RideDemolishAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE);
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND);
}
if ((ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK)
@ -105,8 +105,8 @@ GameActions::Result RideDemolishAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE);
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND);
}
switch (_modifyType)
@ -115,9 +115,10 @@ GameActions::Result RideDemolishAction::Execute() const
return DemolishRide(*ride);
case RIDE_MODIFY_RENEW:
return RefurbishRide(*ride);
default:
LOG_ERROR("Unknown ride demolish type %d", _modifyType);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
}
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE);
}
GameActions::Result RideDemolishAction::DemolishRide(Ride& ride) const

View File

@ -58,14 +58,14 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE);
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND);
}
if (_stationNum.ToUnderlying() >= Limits::MaxStationsPerRide)
{
LOG_WARNING("Invalid station number for ride. stationNum: %u", _stationNum.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE);
LOG_ERROR("Invalid station number for ride. stationNum: %u", _stationNum.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_ERR_VALUE_OUT_OF_RANGE);
}
if (ride->status != RideStatus::Closed && ride->status != RideStatus::Simulating)
@ -143,8 +143,8 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE);
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND);
}
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))

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("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
}
@ -99,9 +99,9 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const
}
else if (entranceElement == nullptr)
{
LOG_WARNING(
"Entrance element not found. x = %d, y = %d, ride = %u, station = %u", _loc.x, _loc.y, _rideIndex.ToUnderlying(),
_stationNum.ToUnderlying());
LOG_ERROR(
"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);
}
@ -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("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
}
@ -137,9 +137,9 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const
}
else if (entranceElement == nullptr)
{
LOG_WARNING(
"Entrance element not found. x = %d, y = %d, ride = %u, station = %d", _loc.x, _loc.y, _rideIndex.ToUnderlying(),
_stationNum);
LOG_ERROR(
"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);
}

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("Ride not found for rideIndex %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: %u", _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("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
}
@ -64,9 +64,9 @@ 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 track colour %u", _index);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR);
}
break;
case RideSetAppearanceType::VehicleColourBody:
@ -74,9 +74,9 @@ 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 vehicle colour %u", _index);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR);
}
break;
case RideSetAppearanceType::VehicleColourScheme:
@ -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 ride appearance type %u", _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("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
}

View File

@ -50,8 +50,9 @@ GameActions::Result RideSetNameAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE);
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND);
}
if (!_name.empty() && Ride::NameExists(_name, ride->id))
@ -68,8 +69,9 @@ GameActions::Result RideSetNameAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE);
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND);
}
if (_name.empty())

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("Ride not found for rideIndex %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("Ride entry not found for ride subtype %u", ride->subtype);
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("Ride not found for rideIndex %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("Ride entry not found for ride subtype %u", ride->subtype);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND);
}

View File

@ -48,8 +48,9 @@ GameActions::Result RideSetSettingAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid ride: #%u.", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
LOG_ERROR("Ride not found for rideIndex %u.", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND);
}
switch (_setting)
@ -69,8 +70,9 @@ GameActions::Result RideSetSettingAction::Query() const
if (!RideIsModeValid(*ride) && !GetGameState().Cheats.ShowAllOperatingModes)
{
LOG_WARNING("Invalid ride mode: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
LOG_ERROR("Invalid ride mode: %u", _value);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
}
break;
case RideSetSetting::Departure:
@ -78,21 +80,23 @@ GameActions::Result RideSetSettingAction::Query() const
case RideSetSetting::MinWaitingTime:
if (_value > 250)
{
LOG_WARNING("Invalid minimum waiting time: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
LOG_ERROR("Invalid minimum waiting time: %u", _value);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
}
break;
case RideSetSetting::MaxWaitingTime:
if (_value > 250)
{
LOG_WARNING("Invalid maximum waiting time: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
LOG_ERROR("Invalid maximum waiting time: %u", _value);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
}
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,8 +104,9 @@ GameActions::Result RideSetSettingAction::Query() const
case RideSetSetting::InspectionInterval:
if (_value > RIDE_INSPECTION_NEVER)
{
LOG_WARNING("Invalid inspection interval: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
LOG_ERROR("Invalid inspection interval: %u", _value);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
}
break;
case RideSetSetting::Music:
@ -112,16 +117,18 @@ GameActions::Result RideSetSettingAction::Query() const
auto musicObj = objManager.GetLoadedObject(ObjectType::Music, _value);
if (musicObj == nullptr)
{
LOG_WARNING("Invalid music style: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
LOG_ERROR("Invalid music style: %u", _value);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
}
break;
}
case RideSetSetting::LiftHillSpeed:
if (!RideIsValidLiftHillSpeed(*ride))
{
LOG_WARNING("Invalid lift hill speed: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
LOG_ERROR("Invalid lift hill speed: %u", _value);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
}
break;
case RideSetSetting::NumCircuits:
@ -134,20 +141,22 @@ GameActions::Result RideSetSettingAction::Query() const
if (!RideIsValidNumCircuits())
{
LOG_WARNING("Invalid number of circuits: %u", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
LOG_ERROR("Invalid number of circuits: %u", _value);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
}
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));
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
LOG_ERROR("Invalid ride setting %u", static_cast<uint8_t>(_setting));
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
}
return GameActions::Result();
@ -158,8 +167,9 @@ GameActions::Result RideSetSettingAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid ride: #%u.", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE);
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND);
}
switch (_setting)

View File

@ -60,16 +60,16 @@ GameActions::Result RideSetStatusAction::Query() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
res.Error = GameActions::Status::InvalidParameters;
res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
res.ErrorMessage = STR_NONE;
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
return res;
}
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,10 +124,10 @@ GameActions::Result RideSetStatusAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying());
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
res.Error = GameActions::Status::InvalidParameters;
res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
res.ErrorMessage = STR_NONE;
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
return res;
}
@ -238,7 +238,7 @@ GameActions::Result RideSetStatusAction::Execute() const
break;
}
default:
Guard::Assert(false, "Invalid status passed: %u", _status);
Guard::Assert(false, "Invalid ride status %u", _status);
break;
}
auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager();

View File

@ -66,15 +66,15 @@ GameActions::Result RideSetVehicleAction::Query() const
{
if (_type >= RideSetVehicleType::Count)
{
LOG_WARNING("Invalid type. type = %d", _type);
LOG_ERROR("Invalid ride vehicle 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());
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND);
}
if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)
@ -97,13 +97,13 @@ GameActions::Result RideSetVehicleAction::Query() const
{
if (!RideIsVehicleTypeValid(*ride))
{
LOG_ERROR("Invalid vehicle type. type = %d", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
LOG_ERROR("Invalid vehicle type %d", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_VALUE_OUT_OF_RANGE);
}
auto rideEntry = GetRideEntryByIndex(_value);
if (rideEntry == nullptr)
{
LOG_WARNING("Invalid ride entry, ride->subtype = %d", ride->subtype);
LOG_ERROR("Ride entry not found for _value %d", _value);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
}
@ -112,14 +112,14 @@ GameActions::Result RideSetVehicleAction::Query() const
if (_colour >= presetList->count && _colour != 255 && _colour != 0)
{
LOG_ERROR("Unknown vehicle colour preset. colour = %d", _colour);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_INVALID_COLOUR);
}
break;
}
default:
LOG_ERROR("Unknown vehicle command. type = %d", _type);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
LOG_ERROR("Invalid ride vehicle setting %d", _type);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_VALUE_OUT_OF_RANGE);
}
return GameActions::Result();
@ -131,8 +131,8 @@ GameActions::Result RideSetVehicleAction::Execute() const
auto ride = GetRide(_rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND);
}
switch (_type)
@ -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("Ride entry not found for index %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("Ride entry not found for index %d", ride->subtype);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
}
@ -200,7 +200,7 @@ GameActions::Result RideSetVehicleAction::Execute() const
}
default:
LOG_ERROR("Unknown vehicle command. type = %d", _type);
LOG_ERROR("Invalid ride vehicle setting %d", _type);
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
}

View File

@ -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);
}
@ -264,7 +264,7 @@ GameActions::Result ScenarioSetSettingAction::Execute() const
break;
}
default:
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);
}

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("Banner not found for bannerIndex %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("Banner not found for bannerIndex %d", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE);
}

View File

@ -50,7 +50,7 @@ GameActions::Result SignSetStyleAction::Query() const
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
LOG_ERROR("Invalid banner id. id = ", _bannerIndex);
LOG_ERROR("Banner not found for bannerIndex %u", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
}
@ -59,12 +59,13 @@ 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("Banner tile element not found for bannerIndex %u", _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(
"Tile element has type %u, expected %d (LargeScenery)", tileElement->GetType(), TileElementType::LargeScenery);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
}
}
@ -74,7 +75,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("Wall element not found for bannerIndex", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
}
}
@ -87,7 +88,7 @@ GameActions::Result SignSetStyleAction::Execute() const
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
LOG_ERROR("Invalid banner id. id = ", _bannerIndex);
LOG_ERROR("Invalid banner id %u", _bannerIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
}

View File

@ -115,12 +115,14 @@ GameActions::Result SmallSceneryPlaceAction::Query() const
auto maxSizeMax = GetMapSizeMaxXY();
if (!_trackDesignDrawingPreview && (_loc.x > maxSizeMax.x || _loc.y > maxSizeMax.y))
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
}
auto* sceneryEntry = ObjectManager::GetObjectEntry<SmallSceneryEntry>(_sceneryType);
if (sceneryEntry == nullptr)
{
LOG_ERROR("Small scenery object entry not found for sceneryType %u", _sceneryType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
}
@ -316,6 +318,7 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const
auto* sceneryEntry = ObjectManager::GetObjectEntry<SmallSceneryEntry>(_sceneryType);
if (sceneryEntry == nullptr)
{
LOG_ERROR("Small scenery object entry not found for sceneryType %u", _sceneryType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
}

View File

@ -66,6 +66,7 @@ GameActions::Result SmallSceneryRemoveAction::Query() const
auto* entry = OpenRCT2::ObjectManager::GetObjectEntry<SmallSceneryEntry>(_sceneryType);
if (entry == nullptr)
{
LOG_ERROR("Invalid small scenery type %u", _sceneryType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
}
@ -102,6 +103,7 @@ GameActions::Result SmallSceneryRemoveAction::Query() const
TileElement* tileElement = FindSceneryElement();
if (tileElement == nullptr)
{
LOG_ERROR("Small scenery of type %u not found at x = %d, y = %d, z = &d", _sceneryType, _loc.x, _loc.y, _loc.z);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
}
@ -116,6 +118,7 @@ GameActions::Result SmallSceneryRemoveAction::Execute() const
auto* entry = OpenRCT2::ObjectManager::GetObjectEntry<SmallSceneryEntry>(_sceneryType);
if (entry == nullptr)
{
LOG_ERROR("Invalid small scenery type %u", _sceneryType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
}

View File

@ -38,7 +38,7 @@ GameActions::Result StaffFireAction::Query() const
{
if (_spriteId.ToUnderlying() >= MAX_ENTITIES || _spriteId.IsNull())
{
LOG_ERROR("Invalid spriteId. spriteId = %u", _spriteId);
LOG_ERROR("Invalid spriteId %u", _spriteId);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@ -46,7 +46,7 @@ GameActions::Result StaffFireAction::Query() const
auto staff = TryGetEntity<Staff>(_spriteId);
if (staff == nullptr)
{
LOG_ERROR("Invalid spriteId. spriteId = %u", _spriteId);
LOG_ERROR("Staff entity not found for spriteId %u", _spriteId);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
}
@ -67,7 +67,7 @@ GameActions::Result StaffFireAction::Execute() const
auto staff = TryGetEntity<Staff>(_spriteId);
if (staff == nullptr)
{
LOG_ERROR("Invalid spriteId. spriteId = %u", _spriteId);
LOG_ERROR("Staff entity not found for spriteId %u", _spriteId);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
}
WindowCloseByClass(WindowClass::FirePrompt);

View File

@ -85,10 +85,8 @@ 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));
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE);
LOG_ERROR("Invalid staff type %u", static_cast<uint32_t>(_staffType));
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE);
}
if (GetNumFreeEntities() < 400)
@ -100,19 +98,17 @@ 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));
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE);
LOG_ERROR("Invalid entertainer type %u", static_cast<uint32_t>(_entertainerType));
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE);
}
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));
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE);
LOG_ERROR("Unavailable entertainer costume %u", static_cast<uint32_t>(_entertainerType));
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE);
}
}

View File

@ -47,6 +47,7 @@ GameActions::Result StaffSetColourAction::Query() const
auto staffType = static_cast<StaffType>(_staffType);
if (staffType != StaffType::Handyman && staffType != StaffType::Mechanic && staffType != StaffType::Security)
{
LOG_ERROR("Staff color can't be changed for staff type %d", _staffType);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE);
}

View File

@ -64,6 +64,7 @@ GameActions::Result StaffSetCostumeAction::Query() const
{
if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull())
{
LOG_ERROR("Invalid sprite index %u", _spriteIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@ -71,14 +72,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("Staff entity not found for spriteIndex %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 entertainer costume %u", _costume);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@ -90,7 +91,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("Staff entity not found for spriteIndex %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
}

View File

@ -49,14 +49,17 @@ GameActions::Result StaffSetNameAction::Query() const
{
if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull())
{
return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE);
LOG_ERROR("Invalid sprite index %u", _spriteIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_VALUE_OUT_OF_RANGE);
}
auto staff = TryGetEntity<Staff>(_spriteIndex);
if (staff == nullptr)
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE);
LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND);
}
return GameActions::Result();
@ -67,8 +70,9 @@ GameActions::Result StaffSetNameAction::Execute() const
auto staff = TryGetEntity<Staff>(_spriteIndex);
if (staff == nullptr)
{
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE);
LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND);
}
auto curName = staff->GetName();

View File

@ -45,6 +45,7 @@ GameActions::Result StaffSetOrdersAction::Query() const
{
if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull())
{
LOG_ERROR("Invalid sprite index %u", _spriteIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}
@ -53,7 +54,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("Staff orders can't be changed for staff of type %u", _spriteIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE);
}
@ -66,7 +67,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("Staff entity not found for spriteIndex %u", _spriteIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
}
staff->StaffOrders = _ordersId;

View File

@ -60,7 +60,7 @@ GameActions::Result StaffSetPatrolAreaAction::QueryExecute(bool executing) const
auto staff = TryGetEntity<Staff>(_spriteId);
if (staff == nullptr)
{
LOG_ERROR("Invalid entity ID: %u", _spriteId.ToUnderlying());
LOG_ERROR("Staff entity not found for spriteID %u", _spriteId.ToUnderlying());
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
}

View File

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

View File

@ -230,7 +230,7 @@ GameActions::Result TileModifyAction::QueryExecute(bool isExecuting) const
break;
}
default:
LOG_ERROR("invalid instruction");
LOG_ERROR("Invalid tile modification type %u", _setting);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
}

View File

@ -90,8 +90,9 @@ GameActions::Result TrackDesignAction::Query() const
auto ride = GetRide(rideIndex);
if (ride == nullptr)
{
LOG_WARNING("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);
LOG_ERROR("Ride not found for rideIndex %d", rideIndex);
return GameActions::Result(
GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
}
bool placeScenery = true;
@ -163,8 +164,9 @@ GameActions::Result TrackDesignAction::Execute() const
auto ride = GetRide(rideIndex);
if (ride == nullptr)
{
LOG_WARNING("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);
LOG_ERROR("Ride not found for rideIndex %d", rideIndex);
return GameActions::Result(
GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
}
// Query first, this is required again to determine if scenery is available.

View File

@ -72,23 +72,23 @@ 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("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)
{
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);
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
}
if (_rideType != ride->type && !GetGameState().Cheats.AllowArbitraryRideTypeChanges)
@ -99,9 +99,9 @@ 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);
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
}
auto res = GameActions::Result();
@ -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);
@ -312,7 +312,8 @@ GameActions::Result TrackPlaceAction::Query() const
if (surfaceElement == nullptr)
{
return GameActions::Result(
GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
auto waterHeight = surfaceElement->GetWaterHeight();
@ -359,7 +360,9 @@ GameActions::Result TrackPlaceAction::Query() const
auto surfaceElement = MapGetSurfaceElementAt(mapLoc);
if (surfaceElement == nullptr)
{
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
return GameActions::Result(
GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
if (!GetGameState().Cheats.DisableSupportLimits)
@ -413,15 +416,15 @@ 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);
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
}
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);
}
@ -530,7 +533,9 @@ GameActions::Result TrackPlaceAction::Execute() const
auto surfaceElement = MapGetSurfaceElementAt(mapLoc);
if (surfaceElement == nullptr)
{
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
return GameActions::Result(
GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
int32_t supportHeight = baseZ - surfaceElement->GetBaseZ();
@ -558,7 +563,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,10 +110,11 @@ 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);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
}
if (tileElement->AsTrack()->IsIndestructible())
@ -129,22 +130,25 @@ GameActions::Result TrackRemoveAction::Query() const
auto ride = GetRide(rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Ride not found. ride index = %d.", rideIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
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);
}
if (ride->type >= RIDE_TYPE_COUNT)
{
LOG_WARNING("Ride type not found. ride type = %d.", ride->type);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
LOG_ERROR("Ride type not found. ride type = %d.", ride->type);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
}
const auto& ted = GetTrackElementDescriptor(trackType);
auto sequenceIndex = tileElement->AsTrack()->GetSequenceIndex();
const PreviewTrack* trackBlock = ted.GetBlockForSequence(sequenceIndex);
if (trackBlock == nullptr)
{
LOG_WARNING("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);
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_ERR_TRACK_BLOCK_NOT_FOUND);
}
auto startLoc = _origin;
@ -204,10 +208,11 @@ 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);
return GameActions::Result(
GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
}
int32_t entranceDirections = std::get<0>(ted.SequenceProperties);
@ -224,8 +229,9 @@ 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);
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
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_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
int8_t _support_height = tileElement->BaseHeight - surfaceElement->BaseHeight;
@ -311,10 +317,11 @@ 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);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
}
RideId rideIndex = tileElement->AsTrack()->GetRideIndex();
@ -324,16 +331,18 @@ GameActions::Result TrackRemoveAction::Execute() const
auto ride = GetRide(rideIndex);
if (ride == nullptr)
{
LOG_WARNING("Ride not found. ride index = %d.", rideIndex);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
LOG_ERROR("Ride not found. ride index = %d.", rideIndex);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND);
}
const auto& ted = GetTrackElementDescriptor(trackType);
auto sequenceIndex = tileElement->AsTrack()->GetSequenceIndex();
const PreviewTrack* trackBlock = ted.GetBlockForSequence(sequenceIndex);
if (trackBlock == nullptr)
{
LOG_WARNING("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);
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_ERR_TRACK_BLOCK_NOT_FOUND);
}
auto startLoc = _origin;
@ -388,10 +397,11 @@ 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);
return GameActions::Result(
GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
}
int32_t entranceDirections = std::get<0>(ted.SequenceProperties);
@ -408,8 +418,9 @@ 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);
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
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_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
int8_t _support_height = tileElement->BaseHeight - surfaceElement->BaseHeight;

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("Track element of type %u not found at x = %d, y = %d, z = %d", _trackType, _loc.x, _loc.y, _loc.z);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND);
}

View File

@ -118,7 +118,8 @@ GameActions::Result WallPlaceAction::Query() const
if (surfaceElement == nullptr)
{
LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
targetHeight = surfaceElement->GetBaseZ();
@ -135,7 +136,8 @@ GameActions::Result WallPlaceAction::Query() const
if (surfaceElement == nullptr)
{
LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
if (surfaceElement->GetWaterHeight() > 0)
@ -299,7 +301,8 @@ GameActions::Result WallPlaceAction::Execute() const
if (surfaceElement == nullptr)
{
LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
targetHeight = surfaceElement->GetBaseZ();

View File

@ -76,7 +76,8 @@ GameActions::Result WallSetColourAction::Query() const
{
LOG_ERROR(
"Could not find wall element at: x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_WALL_ELEMENT_NOT_FOUND);
}
if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(wallElement->IsGhost()))
@ -87,23 +88,23 @@ 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);
}
if (_primaryColour >= COLOUR_COUNT)
{
LOG_ERROR("Primary colour invalid: colour = %d", _primaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
}
if (_secondaryColour >= COLOUR_COUNT)
else if (_secondaryColour >= COLOUR_COUNT)
{
LOG_ERROR("Secondary colour invalid: colour = %d", _secondaryColour);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
}
if (wallEntry->flags & WALL_SCENERY_HAS_TERTIARY_COLOUR)
else if (wallEntry->flags & WALL_SCENERY_HAS_TERTIARY_COLOUR)
{
if (_tertiaryColour >= COLOUR_COUNT)
{
@ -139,7 +140,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);
}

View File

@ -76,7 +76,7 @@ GameActions::Result WaterSetHeightAction::Query() const
SurfaceElement* surfaceElement = MapGetSurfaceElementAt(_coords);
if (surfaceElement == nullptr)
{
LOG_ERROR("Could not find surface element at: x %u, y %u", _coords.x, _coords.y);
LOG_ERROR("No surface element at: x %u, y %u", _coords.x, _coords.y);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}
@ -123,7 +123,7 @@ GameActions::Result WaterSetHeightAction::Execute() const
SurfaceElement* surfaceElement = MapGetSurfaceElementAt(_coords);
if (surfaceElement == nullptr)
{
LOG_ERROR("Could not find surface element at: x %u, y %u", _coords.x, _coords.y);
LOG_ERROR("No surface element at: x %u, y %u", _coords.x, _coords.y);
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
}

View File

@ -4041,6 +4041,8 @@ enum : uint16_t
STR_SHORTCUT_SORT_ELEMENTS = 6624,
STR_ERR_INVALID_COLOUR = 6625,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
/* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings
};