1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Provide more warnings for RideSetColourSchemeAction (#18590)

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
This commit is contained in:
Duncan
2022-11-17 02:45:53 +00:00
committed by GitHub
parent 0d16c63f1e
commit 75f3e82661
3 changed files with 20 additions and 0 deletions

View File

@@ -3630,6 +3630,8 @@ STR_6524 :Increase the priority of the selected asset pack.
STR_6525 :Reload all assets in the game with the enabled asset packs.
STR_6526 :(base graphics, music and sound effects)
STR_6527 :Competitions
STR_6528 :Invalid track parameters!
STR_6529 :Invalid colour scheme parameter!
#############
# Scenarios #

View File

@@ -54,6 +54,22 @@ GameActions::Result RideSetColourSchemeAction::Query() const
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_LAND_NOT_OWNED_BY_PARK);
}
// Find the relevant track piece, prefer sequence 0 (logic copied from GetTrackElementOriginAndApplyChanges)
auto trackElement = MapGetTrackElementAtOfTypeSeq(_loc, _trackType, 0);
if (trackElement == nullptr)
{
trackElement = MapGetTrackElementAtOfType(_loc, _trackType);
if (trackElement == nullptr)
{
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_TRACK_PARAMETERS);
}
}
if (_newColourScheme >= OpenRCT2::Limits::NumColourSchemes)
{
return GameActions::Result(
GameActions::Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_COLOUR_SCHEME_PARAMETER);
}
return GameActions::Result();
}

View File

@@ -3915,6 +3915,8 @@ enum : uint16_t
STR_COMPETITIONS = 6527,
STR_INVALID_TRACK_PARAMETERS = 6528,
STR_INVALID_COLOUR_SCHEME_PARAMETER = 6529,
// 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
};