1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 02:05:13 +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:
Peter Froud
2024-02-19 15:58:04 -08:00
committed by GitHub
parent 1042c428e8
commit 40a7fa70fc
10 changed files with 38 additions and 21 deletions

View File

@@ -100,7 +100,8 @@ GameActions::Result WaterSetHeightAction::Query() const
}
if (surfaceElement->HasTrackThatNeedsWater())
{
return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_NONE);
return GameActions::Result(
GameActions::Status::Disallowed, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ON_THIS_TILE_NEEDS_WATER);
}
res.Cost = 250;