mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-29 17:54:50 +01:00
Fix empty error messages (#21351)
* Add `STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE` * Add `STR_ERR_TRACK_ON_THIS_TILE_NEEDS_WATER` * Return existing `GameAction::Result` * Add `STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE` I am open to suggestions for a different message! Originally this was going to be STR_ERR_WRONG_STAFF_TYPE but I thought that was confusing because the game action arguments do not specify a staff type. We want it to mean "the staff ID you specified is the wrong StaffType for this game action". * Refactor `StaffSetColour()` to return `Result` * Remove unnecessary arguments when `Status` is `Ok` * Refactor `SwapTileElements()` to return `Result` Also add STR_ERR_CANT_SWAP_TILE_ELEMENT_WITH_ITSELF * Format code * Use `STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE` in title * Format code using Github web editor * Format indentation
This commit is contained in:
@@ -47,7 +47,8 @@ GameActions::Result StaffSetColourAction::Query() const
|
||||
auto staffType = static_cast<StaffType>(_staffType);
|
||||
if (staffType != StaffType::Handyman && staffType != StaffType::Mechanic && staffType != StaffType::Security)
|
||||
{
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE);
|
||||
}
|
||||
return GameActions::Result();
|
||||
}
|
||||
@@ -55,9 +56,10 @@ GameActions::Result StaffSetColourAction::Query() const
|
||||
GameActions::Result StaffSetColourAction::Execute() const
|
||||
{
|
||||
// Update global uniform colour property
|
||||
if (!StaffSetColour(static_cast<StaffType>(_staffType), _colour))
|
||||
auto res = StaffSetColour(static_cast<StaffType>(_staffType), _colour);
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
{
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||
return res;
|
||||
}
|
||||
|
||||
// Update each staff member's uniform
|
||||
|
||||
Reference in New Issue
Block a user