mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 00:04:43 +01:00
Refactor explicit constructor usage in LargeScenerySetColourAction
This commit is contained in:
@@ -56,19 +56,19 @@ GameActions::Result::Ptr LargeScenerySetColourAction::QueryExecute(bool isExecut
|
||||
if (_loc.x < 0 || _loc.y < 0 || _loc.x > GetMapSizeMaxXY() || _loc.y > GetMapSizeMaxXY())
|
||||
{
|
||||
log_error("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y);
|
||||
return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS);
|
||||
return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
if (_primaryColour > 31)
|
||||
{
|
||||
log_error("Invalid primary colour: colour = %u", _primaryColour);
|
||||
return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS);
|
||||
return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
if (_secondaryColour > 31)
|
||||
{
|
||||
log_error("Invalid primary colour: colour = %u", _secondaryColour);
|
||||
return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS);
|
||||
return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
auto largeElement = map_get_large_scenery_segment(_loc, _tileIndex);
|
||||
@@ -78,7 +78,7 @@ GameActions::Result::Ptr LargeScenerySetColourAction::QueryExecute(bool isExecut
|
||||
log_error(
|
||||
"Could not find large scenery at: x = %d, y = %d, z = %d, direction = %d, tileIndex = %u", _loc.x, _loc.y, _loc.z,
|
||||
_loc.direction, _tileIndex);
|
||||
return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS);
|
||||
return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(largeElement->IsGhost()))
|
||||
@@ -91,7 +91,7 @@ GameActions::Result::Ptr LargeScenerySetColourAction::QueryExecute(bool isExecut
|
||||
if (sceneryEntry == nullptr)
|
||||
{
|
||||
log_error("Could not find scenery object. type = %u", largeElement->GetEntryIndex());
|
||||
return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS);
|
||||
return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
// Work out the base tile coordinates (Tile with index 0)
|
||||
auto rotatedBaseCoordsOffset = CoordsXYZ{
|
||||
@@ -128,7 +128,7 @@ GameActions::Result::Ptr LargeScenerySetColourAction::QueryExecute(bool isExecut
|
||||
log_error(
|
||||
"Large scenery element not found at: x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z,
|
||||
_loc.direction);
|
||||
return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS);
|
||||
return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
if (isExecuting)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user