forked from rosebudai/OpenRCT2-Web
Rename members of GameActions::Status
This commit is contained in:
110 files changed
+728
-728
No files matched your search
@@ -234,7 +234,7 @@ namespace OpenRCT2
|
||||
listItem.Type, listItem.EntryIndex, colour1, colour2, getGameState().lastEntranceStyle);
|
||||
|
||||
gameAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
return;
|
||||
const auto rideIndex = result->GetData<RideId>();
|
||||
auto ride = GetRide(rideIndex);
|
||||
|
||||
@@ -288,7 +288,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
auto action = GetClearAction();
|
||||
auto result = GameActions::Query(&action, getGameState());
|
||||
auto cost = (result.Error == GameActions::Status::Ok ? result.Cost : kMoney64Undefined);
|
||||
auto cost = (result.Error == GameActions::Status::ok ? result.Cost : kMoney64Undefined);
|
||||
if (_clearSceneryCost != cost)
|
||||
{
|
||||
_clearSceneryCost = cost;
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
gameAction.SetFlags({ CommandFlag::ghost });
|
||||
|
||||
auto result = GameActions::Execute(&gameAction, getGameState());
|
||||
if (result.Error == GameActions::Status::Ok)
|
||||
if (result.Error == GameActions::Status::ok)
|
||||
{
|
||||
gParkEntranceGhostPosition = parkEntrancePosition;
|
||||
gParkEntranceGhostExists = true;
|
||||
@@ -232,7 +232,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
gameAction.SetCallback(
|
||||
[&](const GameActions::GameAction*, const GameActions::Result* result) { _placingEntrance = false; });
|
||||
auto result = GameActions::Execute(&gameAction, getGameState());
|
||||
if (result.Error == GameActions::Status::Ok)
|
||||
if (result.Error == GameActions::Status::ok)
|
||||
{
|
||||
Audio::Play3D(Audio::SoundId::placeItem, result.Position);
|
||||
}
|
||||
|
||||
@@ -1276,7 +1276,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto footpathPlaceAction = GameActions::FootpathPlaceAction(
|
||||
tile.position, tile.slope, selectedType, gFootpathSelection.Railings, kInvalidDirection, constructFlags);
|
||||
auto result = GameActions::Execute(&footpathPlaceAction, getGameState());
|
||||
if (result.Error == GameActions::Status::Ok)
|
||||
if (result.Error == GameActions::Status::ok)
|
||||
{
|
||||
anySuccess = true;
|
||||
cost += result.Cost;
|
||||
@@ -1326,7 +1326,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
{ *mapPos, placement.baseZ }, placement.slope, selectedType, gFootpathSelection.Railings, kInvalidDirection,
|
||||
constructFlags);
|
||||
footpathPlaceAction.SetCallback([this](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
if (result->Error == GameActions::Status::ok)
|
||||
{
|
||||
// Don't play sound if it is no cost to prevent multiple sounds. TODO: make this work in no money scenarios
|
||||
if (result->Cost != 0)
|
||||
@@ -1420,7 +1420,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
footpathPlaceAction.SetCallback(
|
||||
[footpathLoc](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
if (result->Error == GameActions::Status::ok)
|
||||
{
|
||||
Audio::Play3D(OpenRCT2::Audio::SoundId::placeItem, result->Position);
|
||||
}
|
||||
@@ -1432,7 +1432,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
return;
|
||||
}
|
||||
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
if (result->Error == GameActions::Status::ok)
|
||||
{
|
||||
if (_footpathConstructSlope == SlopePitch::flat)
|
||||
{
|
||||
@@ -1942,7 +1942,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
res = GameActions::Execute(&footpathPlaceAction, getGameState());
|
||||
// The latter status will be returned if there is already path at the tile in question, to prevent a ghost
|
||||
// from glitching through the existing path.
|
||||
if (res.Error == GameActions::Status::Ok || res.Error == GameActions::Status::ItemAlreadyPlaced)
|
||||
if (res.Error == GameActions::Status::ok || res.Error == GameActions::Status::itemAlreadyPlaced)
|
||||
{
|
||||
succesfulTiles.emplace_back(tile);
|
||||
cost += res.Cost;
|
||||
|
||||
@@ -661,7 +661,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
Network::GetCurrentPlayerId() };
|
||||
pickupAction.SetCallback(
|
||||
[peepnum = number](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
return;
|
||||
auto* windowMgr = GetWindowManager();
|
||||
WindowBase* wind = windowMgr->FindByNumber(WindowClass::peep, peepnum);
|
||||
@@ -1027,7 +1027,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
{ destCoords, tileElement->GetBaseZ() },
|
||||
Network::GetCurrentPlayerId() };
|
||||
pickupAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
return;
|
||||
ToolCancel();
|
||||
gPickupPeepImage = ImageId();
|
||||
|
||||
@@ -356,7 +356,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
gMapSelectType, false);
|
||||
auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landSmoothAction, gameState)
|
||||
: GameActions::Query(&landSmoothAction, gameState);
|
||||
return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
|
||||
return res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined;
|
||||
}
|
||||
|
||||
auto landRaiseAction = GameActions::LandRaiseAction(
|
||||
@@ -365,7 +365,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landRaiseAction, gameState)
|
||||
: GameActions::Query(&landRaiseAction, gameState);
|
||||
|
||||
return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
|
||||
return res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -389,7 +389,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
gMapSelectType, true);
|
||||
auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landSmoothAction, gameState)
|
||||
: GameActions::Query(&landSmoothAction, gameState);
|
||||
return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
|
||||
return res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined;
|
||||
}
|
||||
|
||||
auto landLowerAction = GameActions::LandLowerAction(
|
||||
@@ -398,7 +398,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landLowerAction, gameState)
|
||||
: GameActions::Query(&landLowerAction, gameState);
|
||||
|
||||
return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
|
||||
return res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -536,13 +536,13 @@ namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
auto landSetRightsAction = GetLandSetAction();
|
||||
auto res = GameActions::Query(&landSetRightsAction, gameState);
|
||||
_landRightsCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
|
||||
_landRightsCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto landBuyRightsAction = GetLandBuyAction();
|
||||
auto res = GameActions::Query(&landBuyRightsAction, gameState);
|
||||
_landRightsCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
|
||||
_landRightsCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -484,7 +484,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
auto gameAction = GameActions::PeepSpawnPlaceAction({ mapCoords, mapZ, static_cast<Direction>(direction) });
|
||||
auto result = GameActions::Execute(&gameAction, getGameState());
|
||||
if (result.Error == GameActions::Status::Ok)
|
||||
if (result.Error == GameActions::Status::ok)
|
||||
{
|
||||
Audio::Play3D(Audio::SoundId::placeItem, result.Position);
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
rideEntranceExitPlaceAction.SetCallback([=, this](
|
||||
const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
return;
|
||||
|
||||
OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::placeItem, result->Position);
|
||||
@@ -429,7 +429,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto action = GameActions::MazeSetTrackAction(loc, false, _currentRideIndex, mode);
|
||||
action.SetFlags(actionFlags);
|
||||
const auto res = GameActions::Execute(&action, getGameState());
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
if (res.Error != GameActions::Status::ok)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto gameAction = GameActions::ParkMarketingAction(
|
||||
Campaign.campaign_type, Campaign.RideId.ToUnderlying(), Campaign.no_weeks);
|
||||
gameAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
if (result->Error == GameActions::Status::ok)
|
||||
{
|
||||
auto* windowMgr = Ui::GetWindowManager();
|
||||
windowMgr->CloseByClass(WindowClass::newCampaign);
|
||||
|
||||
@@ -533,7 +533,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto playerSetGroupAction = GameActions::PlayerSetGroupAction(playerId, groupId);
|
||||
playerSetGroupAction.SetCallback(
|
||||
[windowHandle](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
if (result->Error == GameActions::Status::ok)
|
||||
{
|
||||
auto* windowMgr = Ui::GetWindowManager();
|
||||
windowMgr->InvalidateByNumber(windowHandle.first, windowHandle.second);
|
||||
|
||||
@@ -4483,7 +4483,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
rideId, GameActions::RideSetAppearanceType::EntranceStyle, objIndex, 0);
|
||||
rideSetAppearanceAction.SetCallback(
|
||||
[objIndex](const GameActions::GameAction*, const GameActions::Result* res) {
|
||||
if (res->Error != GameActions::Status::Ok)
|
||||
if (res->Error != GameActions::Status::ok)
|
||||
return;
|
||||
getGameState().lastEntranceStyle = objIndex;
|
||||
});
|
||||
@@ -4496,7 +4496,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
rideId, GameActions::RideSetAppearanceType::VehicleColourScheme, dropdownIndex, 0);
|
||||
rideSetAppearanceAction.SetCallback(
|
||||
[this](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
if (result->Error == GameActions::Status::ok)
|
||||
{
|
||||
resetVehicleIndex();
|
||||
}
|
||||
|
||||
@@ -2337,7 +2337,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
|
||||
auto res = GameActions::Execute(&trackPlaceAction, getGameState());
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
if (res.Error != GameActions::Status::ok)
|
||||
{
|
||||
_trackPlaceCost = kMoney64Undefined;
|
||||
_trackPlaceErrorMessage = std::get<StringId>(res.ErrorMessage);
|
||||
@@ -2348,7 +2348,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
_trackPlaceErrorMessage = kStringIdNone;
|
||||
}
|
||||
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
if (res.Error != GameActions::Status::ok)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2460,7 +2460,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
{ _currentTrackBegin.x, _currentTrackBegin.y, _currentTrackBegin.z, currentDirection });
|
||||
|
||||
trackRemoveAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
{
|
||||
WindowRideConstructionUpdateActiveElements();
|
||||
}
|
||||
@@ -2665,7 +2665,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
rideEntranceExitPlaceAction.SetCallback(
|
||||
[=, this](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
return;
|
||||
|
||||
OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::placeItem, result->Position);
|
||||
@@ -2951,7 +2951,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
static void RideConstructPlacedForwardGameActionCallback(
|
||||
const GameActions::GameAction* ga, const GameActions::Result* result)
|
||||
{
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
{
|
||||
WindowRideConstructionUpdateActiveElements();
|
||||
return;
|
||||
@@ -2998,7 +2998,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
static void RideConstructPlacedBackwardGameActionCallback(
|
||||
const GameActions::GameAction* ga, const GameActions::Result* result)
|
||||
{
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
{
|
||||
WindowRideConstructionUpdateActiveElements();
|
||||
return;
|
||||
@@ -3700,7 +3700,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto gameAction = GameActions::MazeSetTrackAction(
|
||||
CoordsXYZD{ _currentTrackBegin, 0 }, true, _currentRideIndex, GC_SET_MAZE_TRACK_BUILD);
|
||||
auto mazeSetTrackResult = GameActions::Execute(&gameAction, getGameState());
|
||||
if (mazeSetTrackResult.Error == GameActions::Status::Ok)
|
||||
if (mazeSetTrackResult.Error == GameActions::Status::ok)
|
||||
{
|
||||
_trackPlaceCost = mazeSetTrackResult.Cost;
|
||||
_trackPlaceErrorMessage = kStringIdNone;
|
||||
@@ -3713,7 +3713,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
gDisableErrorWindowSound = false;
|
||||
|
||||
if (mazeSetTrackResult.Error != GameActions::Status::Ok)
|
||||
if (mazeSetTrackResult.Error != GameActions::Status::ok)
|
||||
{
|
||||
_rideConstructionState = RideConstructionState::Place;
|
||||
StringId errorText = std::get<StringId>(mazeSetTrackResult.ErrorMessage);
|
||||
@@ -4762,7 +4762,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
gameAction.SetFlags(flags);
|
||||
auto result = GameActions::Execute(&gameAction, getGameState());
|
||||
|
||||
if (result.Error != GameActions::Status::Ok)
|
||||
if (result.Error != GameActions::Status::ok)
|
||||
return kMoney64Undefined;
|
||||
|
||||
_unkF440C5 = { trackPos, static_cast<Direction>(trackDirection) };
|
||||
@@ -4780,7 +4780,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
trackPlaceAction.SetFlags({ CommandFlag::allowDuringPaused, CommandFlag::noSpend, CommandFlag::ghost });
|
||||
// This command must not be sent over the network
|
||||
auto res = GameActions::Execute(&trackPlaceAction, getGameState());
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
if (res.Error != GameActions::Status::ok)
|
||||
return kMoney64Undefined;
|
||||
|
||||
int16_t zBegin{}, zEnd{};
|
||||
|
||||
@@ -2054,7 +2054,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
loc, quadrant, entryIndex, primaryColour, secondaryColour, tertiaryColour);
|
||||
smallSceneryPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused });
|
||||
auto res = GameActions::Execute(&smallSceneryPlaceAction, getGameState());
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
if (res.Error != GameActions::Status::ok)
|
||||
return kMoney64Undefined;
|
||||
|
||||
const auto placementData = res.GetData<GameActions::SmallSceneryPlaceActionResult>();
|
||||
@@ -2088,7 +2088,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto footpathAdditionPlaceAction = GameActions::FootpathAdditionPlaceAction(loc, entryIndex);
|
||||
footpathAdditionPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused });
|
||||
footpathAdditionPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2096,7 +2096,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
gSceneryGhostType |= SCENERY_GHOST_FLAG_1;
|
||||
});
|
||||
auto res = GameActions::Execute(&footpathAdditionPlaceAction, getGameState());
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
if (res.Error != GameActions::Status::ok)
|
||||
return kMoney64Undefined;
|
||||
|
||||
return res.Cost;
|
||||
@@ -2113,7 +2113,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
entryIndex, loc, edge, primaryColour, secondaryColour, tertiaryColour);
|
||||
wallPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused, CommandFlag::noSpend });
|
||||
wallPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
return;
|
||||
|
||||
const auto placementData = result->GetData<GameActions::WallPlaceActionResult>();
|
||||
@@ -2124,7 +2124,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
});
|
||||
|
||||
auto res = GameActions::Execute(&wallPlaceAction, getGameState());
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
if (res.Error != GameActions::Status::ok)
|
||||
return kMoney64Undefined;
|
||||
|
||||
return res.Cost;
|
||||
@@ -2141,7 +2141,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
loc, entryIndex, primaryColour, secondaryColour, tertiaryColour);
|
||||
sceneryPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused, CommandFlag::noSpend });
|
||||
auto res = GameActions::Execute(&sceneryPlaceAction, getGameState());
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
if (res.Error != GameActions::Status::ok)
|
||||
return kMoney64Undefined;
|
||||
|
||||
const auto placementData = res.GetData<GameActions::LargeSceneryPlaceActionResult>();
|
||||
@@ -2173,7 +2173,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto bannerPlaceAction = GameActions::BannerPlaceAction(loc, entryIndex, primaryColour);
|
||||
bannerPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused, CommandFlag::noSpend });
|
||||
auto res = GameActions::Execute(&bannerPlaceAction, getGameState());
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
if (res.Error != GameActions::Status::ok)
|
||||
return kMoney64Undefined;
|
||||
|
||||
gSceneryGhostPosition = loc;
|
||||
@@ -2965,7 +2965,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
zAttemptRange = 20;
|
||||
}
|
||||
|
||||
auto success = GameActions::Status::Unknown;
|
||||
auto success = GameActions::Status::unknown;
|
||||
// Try find a valid z coordinate
|
||||
for (; zAttemptRange != 0; zAttemptRange--)
|
||||
{
|
||||
@@ -2976,12 +2976,12 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto& gameState = getGameState();
|
||||
auto res = GameActions::Query(&smallSceneryPlaceAction, gameState);
|
||||
success = res.Error;
|
||||
if (res.Error == GameActions::Status::Ok)
|
||||
if (res.Error == GameActions::Status::ok)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (res.Error == GameActions::Status::InsufficientFunds)
|
||||
if (res.Error == GameActions::Status::insufficientFunds)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -2992,7 +2992,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
|
||||
// Actually place
|
||||
if (success == GameActions::Status::Ok || ((q + 1 == quantity) && forceError))
|
||||
if (success == GameActions::Status::ok || ((q + 1 == quantity) && forceError))
|
||||
{
|
||||
auto smallSceneryPlaceAction = GameActions::SmallSceneryPlaceAction(
|
||||
{ cur_grid_x, cur_grid_y, gSceneryPlaceZ, gSceneryPlaceRotation }, quadrant, selectedScenery,
|
||||
@@ -3000,7 +3000,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
smallSceneryPlaceAction.SetCallback(
|
||||
[=](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
if (result->Error == GameActions::Status::ok)
|
||||
{
|
||||
Audio::Play3D(Audio::SoundId::placeItem, result->Position);
|
||||
}
|
||||
@@ -3008,12 +3008,12 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
auto& gameState = getGameState();
|
||||
auto res = GameActions::Execute(&smallSceneryPlaceAction, gameState);
|
||||
if (res.Error == GameActions::Status::Ok)
|
||||
if (res.Error == GameActions::Status::ok)
|
||||
{
|
||||
forceError = false;
|
||||
}
|
||||
|
||||
if (res.Error == GameActions::Status::InsufficientFunds)
|
||||
if (res.Error == GameActions::Status::insufficientFunds)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -3034,7 +3034,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto footpathAdditionPlaceAction = GameActions::FootpathAdditionPlaceAction({ gridPos, z }, selectedScenery);
|
||||
|
||||
footpathAdditionPlaceAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -3092,7 +3092,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
auto& gameState = getGameState();
|
||||
auto res = GameActions::Query(&wallPlaceAction, gameState);
|
||||
if (res.Error == GameActions::Status::Ok)
|
||||
if (res.Error == GameActions::Status::ok)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -3184,7 +3184,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
wallPlaceAction.SetFlags({ CommandFlag::ghost, CommandFlag::allowDuringPaused });
|
||||
|
||||
auto result = GameActions::Execute(&wallPlaceAction, gameState);
|
||||
if (result.Error == GameActions::Status::Ok)
|
||||
if (result.Error == GameActions::Status::ok)
|
||||
{
|
||||
const auto placementData = result.GetData<GameActions::WallPlaceActionResult>();
|
||||
_provisionalTiles.push_back({ CoordsXYZD(x, y, gSceneryPlaceZ, _startEdge), placementData.BaseHeight });
|
||||
@@ -3233,7 +3233,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto z = gSceneryPlaceZ > 0 ? gSceneryPlaceZ : TileElementHeight(_dragStartPos);
|
||||
Audio::Play3D(Audio::SoundId::error, { _dragStartPos, z });
|
||||
|
||||
if (_lastProvisionalError.Error != GameActions::Status::Ok)
|
||||
if (_lastProvisionalError.Error != GameActions::Status::ok)
|
||||
{
|
||||
auto windowManager = Ui::GetWindowManager();
|
||||
windowManager->ShowError(
|
||||
@@ -3255,7 +3255,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
auto& gameState = getGameState();
|
||||
auto result = GameActions::Execute(&wallPlaceAction, gameState);
|
||||
if (result.Error == GameActions::Status::Ok)
|
||||
if (result.Error == GameActions::Status::ok)
|
||||
{
|
||||
anySuccessful = true;
|
||||
lastLocation = result.Position;
|
||||
@@ -3294,7 +3294,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
auto& gameState = getGameState();
|
||||
auto res = GameActions::Query(&sceneryPlaceAction, gameState);
|
||||
if (res.Error == GameActions::Status::Ok)
|
||||
if (res.Error == GameActions::Status::ok)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -3318,7 +3318,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto sceneryPlaceAction = GameActions::LargeSceneryPlaceAction(
|
||||
loc, selectedScenery, _sceneryPrimaryColour, _scenerySecondaryColour, _sceneryTertiaryColour);
|
||||
sceneryPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
if (result->Error == GameActions::Status::ok)
|
||||
{
|
||||
Audio::Play3D(Audio::SoundId::placeItem, result->Position);
|
||||
}
|
||||
@@ -3345,7 +3345,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto primaryColour = _sceneryPrimaryColour;
|
||||
auto bannerPlaceAction = GameActions::BannerPlaceAction(loc, selectedScenery, primaryColour);
|
||||
bannerPlaceAction.SetCallback([=](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
if (result->Error == GameActions::Status::ok)
|
||||
{
|
||||
auto data = result->GetData<GameActions::BannerPlaceActionResult>();
|
||||
Audio::Play3D(Audio::SoundId::placeItem, result->Position);
|
||||
|
||||
@@ -388,7 +388,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
Network::GetCurrentPlayerId() };
|
||||
pickupAction.SetCallback(
|
||||
[peepnum = number](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
return;
|
||||
|
||||
auto* windowMgr = GetWindowManager();
|
||||
@@ -719,7 +719,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
{ destCoords, tileElement->GetBaseZ() },
|
||||
Network::GetCurrentPlayerId() };
|
||||
pickupAction.SetCallback([](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
return;
|
||||
ToolCancel();
|
||||
gPickupPeepImage = ImageId();
|
||||
|
||||
@@ -546,7 +546,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
auto hireStaffAction = GameActions::StaffHireNewAction(autoPosition, staffType, costume, staffOrders);
|
||||
hireStaffAction.SetCallback([=](const GameActions::GameAction*, const GameActions::Result* res) -> void {
|
||||
if (res->Error != GameActions::Status::Ok)
|
||||
if (res->Error != GameActions::Status::ok)
|
||||
return;
|
||||
|
||||
auto actionResult = res->GetData<GameActions::StaffHireNewActionResult>();
|
||||
@@ -564,7 +564,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
Network::GetCurrentPlayerId() };
|
||||
pickupAction.SetCallback(
|
||||
[staffId = staff->Id](const GameActions::GameAction* ga, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
return;
|
||||
|
||||
auto* staff2 = getGameState().entities.GetEntity<Staff>(staffId);
|
||||
|
||||
@@ -222,13 +222,13 @@ namespace OpenRCT2::Ui::Windows
|
||||
CoordsXYZD ghostTrackLoc = trackLoc;
|
||||
auto res = FindValidTrackDesignPlaceHeight(ghostTrackLoc, { CommandFlag::noSpend, CommandFlag::ghost });
|
||||
|
||||
if (res.Error == GameActions::Status::Ok)
|
||||
if (res.Error == GameActions::Status::ok)
|
||||
{
|
||||
// Valid location found. Place the ghost at the location.
|
||||
auto tdAction = GameActions::TrackDesignAction(ghostTrackLoc, *_trackDesign, !gTrackDesignSceneryToggle);
|
||||
tdAction.SetFlags({ CommandFlag::noSpend, CommandFlag::ghost });
|
||||
tdAction.SetCallback([&](const GameActions::GameAction*, const GameActions::Result* result) {
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
if (result->Error == GameActions::Status::ok)
|
||||
{
|
||||
_placementGhostRideId = result->GetData<RideId>();
|
||||
_placementGhostLoc = ghostTrackLoc;
|
||||
@@ -236,7 +236,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
});
|
||||
res = GameActions::Execute(&tdAction, getGameState());
|
||||
cost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
|
||||
cost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined;
|
||||
|
||||
VirtualFloorSetHeight(ghostTrackLoc.z);
|
||||
}
|
||||
@@ -284,7 +284,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
// Try increasing Z until a feasible placement is found
|
||||
CoordsXYZ trackLoc = { mapCoords, maybeMapZ.value() };
|
||||
auto res = FindValidTrackDesignPlaceHeight(trackLoc, {});
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
if (res.Error != GameActions::Status::ok)
|
||||
{
|
||||
// Unable to build track
|
||||
Audio::Play3D(Audio::SoundId::error, trackLoc);
|
||||
@@ -299,7 +299,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto tdAction = GameActions::TrackDesignAction(
|
||||
{ trackLoc, _currentTrackPieceDirection }, *_trackDesign, !gTrackDesignSceneryToggle);
|
||||
tdAction.SetCallback([&, trackLoc](const GameActions::GameAction*, const GameActions::Result* result) {
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
if (result->Error != GameActions::Status::ok)
|
||||
{
|
||||
Audio::Play3D(Audio::SoundId::error, result->Position);
|
||||
_placingTrackDesign = false;
|
||||
@@ -403,7 +403,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
{ _placementGhostLoc }, *_trackDesign, !gTrackDesignSceneryToggle);
|
||||
tdAction.SetFlags({ CommandFlag::noSpend, CommandFlag::ghost });
|
||||
auto res = GameActions::Execute(&tdAction, getGameState());
|
||||
if (res.Error != GameActions::Status::Ok)
|
||||
if (res.Error != GameActions::Status::ok)
|
||||
{
|
||||
_hasPlacementGhost = false;
|
||||
}
|
||||
@@ -753,7 +753,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
// If successful don't keep trying.
|
||||
// If failure due to no money then increasing height only makes problem worse
|
||||
if (res.Error == GameActions::Status::Ok || res.Error == GameActions::Status::InsufficientFunds)
|
||||
if (res.Error == GameActions::Status::ok || res.Error == GameActions::Status::insufficientFunds)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -308,10 +308,10 @@ namespace OpenRCT2::Ui::Windows
|
||||
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y });
|
||||
|
||||
auto res = GameActions::Query(&waterLowerAction, gameState);
|
||||
money64 lowerCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
|
||||
money64 lowerCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined;
|
||||
|
||||
res = GameActions::Query(&waterRaiseAction, gameState);
|
||||
money64 raiseCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
|
||||
money64 raiseCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined;
|
||||
|
||||
if (_waterToolRaiseCost != raiseCost || _waterToolLowerCost != lowerCost)
|
||||
{
|
||||
@@ -398,10 +398,10 @@ namespace OpenRCT2::Ui::Windows
|
||||
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y });
|
||||
|
||||
auto res = GameActions::Query(&waterLowerAction, gameState);
|
||||
money64 lowerCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
|
||||
money64 lowerCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined;
|
||||
|
||||
res = GameActions::Query(&waterRaiseAction, gameState);
|
||||
money64 raiseCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
|
||||
money64 raiseCost = res.Error == GameActions::Status::ok ? res.Cost : kMoney64Undefined;
|
||||
|
||||
if (_waterToolRaiseCost != raiseCost || _waterToolLowerCost != lowerCost)
|
||||
{
|
||||
|
||||
@@ -864,7 +864,7 @@ namespace OpenRCT2
|
||||
action->SetFlags(action->GetFlags().with(CommandFlag::replay));
|
||||
|
||||
GameActions::Result result = GameActions::Execute(action, gameState);
|
||||
if (result.Error == GameActions::Status::Ok)
|
||||
if (result.Error == GameActions::Status::ok)
|
||||
{
|
||||
isPositionValid = true;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRCT2::GameActions
|
||||
if (balloon == nullptr)
|
||||
{
|
||||
LOG_ERROR("Balloon not found for spriteIndex %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND);
|
||||
}
|
||||
return Result();
|
||||
}
|
||||
@@ -55,7 +55,7 @@ namespace OpenRCT2::GameActions
|
||||
if (balloon == nullptr)
|
||||
{
|
||||
LOG_ERROR("Balloon not found for spriteIndex %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND);
|
||||
}
|
||||
|
||||
balloon->Press();
|
||||
|
||||
@@ -62,45 +62,45 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (!MapCheckCapacityAndReorganise(_loc))
|
||||
{
|
||||
LOG_ERROR("No free map elements.");
|
||||
return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
||||
auto pathElement = GetValidPathElement();
|
||||
|
||||
if (pathElement == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_BUILT_ACROSS_PATHS);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_BUILT_ACROSS_PATHS);
|
||||
}
|
||||
|
||||
if (!MapCanBuildAt(_loc))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
auto baseHeight = _loc.z + kPathHeightStep;
|
||||
BannerElement* existingBannerElement = MapGetBannerElementAt({ _loc.x, _loc.y, baseHeight }, _loc.direction);
|
||||
if (existingBannerElement != nullptr)
|
||||
{
|
||||
return Result(Status::ItemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, STR_BANNER_SIGN_IN_THE_WAY);
|
||||
return Result(Status::itemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, STR_BANNER_SIGN_IN_THE_WAY);
|
||||
}
|
||||
|
||||
if (HasReachedBannerLimit())
|
||||
{
|
||||
LOG_ERROR("No free banners available");
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
|
||||
auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry<BannerSceneryEntry>(_bannerType);
|
||||
if (bannerEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner entry not found for bannerType %u", _bannerType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
res.Cost = bannerEntry->price;
|
||||
res.SetData(BannerPlaceActionResult{});
|
||||
@@ -120,21 +120,21 @@ namespace OpenRCT2::GameActions
|
||||
if (!MapCheckCapacityAndReorganise(_loc))
|
||||
{
|
||||
LOG_ERROR("No free map elements.");
|
||||
return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
||||
auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry<BannerSceneryEntry>(_bannerType);
|
||||
if (bannerEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner entry not found for bannerType %u", _bannerType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto banner = CreateBanner();
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("No free banners available");
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
banner->flags = {};
|
||||
banner->text = {};
|
||||
|
||||
@@ -55,11 +55,11 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
if (!MapCanBuildAt({ _loc.x, _loc.y, _loc.z - 16 }))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
BannerElement* bannerElement = GetBannerElementAt();
|
||||
@@ -67,21 +67,21 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
LOG_ERROR(
|
||||
"Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
auto bannerIndex = bannerElement->GetIndex();
|
||||
if (bannerIndex == BannerIndex::GetNull())
|
||||
{
|
||||
LOG_ERROR("Invalid banner index %u", bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
auto banner = bannerElement->GetBanner();
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid banner index %u", bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
auto* bannerEntry = ObjectManager::GetObjectEntry<BannerSceneryEntry>(banner->type);
|
||||
@@ -107,21 +107,21 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
LOG_ERROR(
|
||||
"Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
auto bannerIndex = bannerElement->GetIndex();
|
||||
if (bannerIndex == BannerIndex::GetNull())
|
||||
{
|
||||
LOG_ERROR("Invalid banner index %u", bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
auto banner = bannerElement->GetBanner();
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid banner index %u", bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
auto* bannerEntry = ObjectManager::GetObjectEntry<BannerSceneryEntry>(banner->type);
|
||||
|
||||
@@ -66,18 +66,18 @@ namespace OpenRCT2::GameActions
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
LOG_ERROR("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (_primaryColour > 31)
|
||||
{
|
||||
LOG_ERROR("Invalid primary colour %u", _primaryColour);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
|
||||
if (!MapCanBuildAt({ _loc.x, _loc.y, _loc.z - 16 }))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
auto bannerElement = MapGetBannerElementAt(_loc, _loc.direction);
|
||||
@@ -85,7 +85,7 @@ namespace OpenRCT2::GameActions
|
||||
if (bannerElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No banner at x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction);
|
||||
return Result(Status::Unknown, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::unknown, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto index = bannerElement->GetIndex();
|
||||
@@ -93,7 +93,7 @@ namespace OpenRCT2::GameActions
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid banner index %u", index);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
if (isExecuting)
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRCT2::GameActions
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
TileElement* tileElement = BannerGetTileElement(_bannerIndex);
|
||||
@@ -59,7 +59,7 @@ namespace OpenRCT2::GameActions
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner tile element not found for bannerIndex %d", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
BannerElement* bannerElement = tileElement->AsBanner();
|
||||
@@ -67,11 +67,11 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
if (!MapCanBuildAt({ loc.x, loc.y, loc.z - 16 }))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -83,7 +83,7 @@ namespace OpenRCT2::GameActions
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
banner->text = _name;
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenRCT2::GameActions
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, errorTitle, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, errorTitle, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
res.Expenditure = ExpenditureType::landscaping;
|
||||
@@ -73,7 +73,7 @@ namespace OpenRCT2::GameActions
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner tile element not found for bannerIndex %d", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, errorTitle, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, errorTitle, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
BannerElement* bannerElement = tileElement->AsBanner();
|
||||
@@ -81,11 +81,11 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, errorTitle, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, errorTitle, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
if (!MapCanBuildAt({ loc.x, loc.y, loc.z - 16 }))
|
||||
{
|
||||
return Result(Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
switch (_type)
|
||||
@@ -94,7 +94,7 @@ namespace OpenRCT2::GameActions
|
||||
if (_parameter > COLOUR_COUNT)
|
||||
{
|
||||
LOG_ERROR("Invalid primary colour %u", _parameter);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -102,19 +102,19 @@ namespace OpenRCT2::GameActions
|
||||
if (_parameter > 13)
|
||||
{
|
||||
LOG_ERROR("Invalid text colour %u", _parameter);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
break;
|
||||
case BannerSetStyleType::NoEntry:
|
||||
if (tileElement->AsBanner() == nullptr)
|
||||
{
|
||||
LOG_ERROR("Tile element was not a banner.");
|
||||
return Result(Status::Unknown, STR_CANT_RENAME_BANNER, kStringIdNone);
|
||||
return Result(Status::unknown, STR_CANT_RENAME_BANNER, kStringIdNone);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("Invalid banner style type %u", _type);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ namespace OpenRCT2::GameActions
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
res.Expenditure = ExpenditureType::landscaping;
|
||||
@@ -139,7 +139,7 @@ namespace OpenRCT2::GameActions
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner tile element not found for bannerIndex &u", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
switch (_type)
|
||||
@@ -156,7 +156,7 @@ namespace OpenRCT2::GameActions
|
||||
if (bannerElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Tile element was not a banner.");
|
||||
return Result(Status::Unknown, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::unknown, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
banner->flags.set(BannerFlag::noEntry, (_parameter != 0));
|
||||
@@ -170,7 +170,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
default:
|
||||
LOG_ERROR("Invalid banner style type %u", _type);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
auto intent = Intent(INTENT_ACTION_UPDATE_BANNER);
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace OpenRCT2::GameActions
|
||||
if (static_cast<uint32_t>(_cheatType) >= static_cast<uint32_t>(CheatType::count))
|
||||
{
|
||||
LOG_ERROR("Invalid cheat type %u", _cheatType);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
ParametersRange validRange = GetParameterRange(static_cast<CheatType>(_cheatType.id));
|
||||
@@ -89,14 +89,14 @@ namespace OpenRCT2::GameActions
|
||||
LOG_ERROR(
|
||||
"The first cheat parameter is out of range. Value = %d, min = %d, max = %d", _param1, validRange.first.first,
|
||||
validRange.first.second);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(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 Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -274,7 +274,7 @@ namespace OpenRCT2::GameActions
|
||||
default:
|
||||
{
|
||||
LOG_ERROR("Invalid cheat type %d", _cheatType.id);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace OpenRCT2::GameActions
|
||||
auto result = CreateResult();
|
||||
|
||||
auto noValidTiles = true;
|
||||
auto error = Status::Ok;
|
||||
auto error = Status::ok;
|
||||
StringId errorMessage = kStringIdNone;
|
||||
money64 totalCost = 0;
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
else
|
||||
{
|
||||
error = Status::NotOwned;
|
||||
error = Status::notOwned;
|
||||
errorMessage = STR_LAND_NOT_OWNED_BY_PARK;
|
||||
}
|
||||
}
|
||||
@@ -149,12 +149,12 @@ namespace OpenRCT2::GameActions
|
||||
auto res = executing ? ExecuteNested(&footpathRemoveAction, gameState)
|
||||
: QueryNested(&footpathRemoveAction, gameState);
|
||||
|
||||
if (res.Error == Status::Ok)
|
||||
if (res.Error == Status::ok)
|
||||
{
|
||||
totalCost += res.Cost;
|
||||
tileEdited = executing;
|
||||
}
|
||||
else if (res.Error == Status::InsufficientFunds)
|
||||
else if (res.Error == Status::insufficientFunds)
|
||||
{
|
||||
totalCost += res.Cost;
|
||||
}
|
||||
@@ -171,12 +171,12 @@ namespace OpenRCT2::GameActions
|
||||
auto res = executing ? ExecuteNested(&removeSceneryAction, gameState)
|
||||
: QueryNested(&removeSceneryAction, gameState);
|
||||
|
||||
if (res.Error == Status::Ok)
|
||||
if (res.Error == Status::ok)
|
||||
{
|
||||
totalCost += res.Cost;
|
||||
tileEdited = executing;
|
||||
}
|
||||
else if (res.Error == Status::InsufficientFunds)
|
||||
else if (res.Error == Status::insufficientFunds)
|
||||
{
|
||||
totalCost += res.Cost;
|
||||
}
|
||||
@@ -192,12 +192,12 @@ namespace OpenRCT2::GameActions
|
||||
auto res = executing ? ExecuteNested(&wallRemoveAction, gameState)
|
||||
: QueryNested(&wallRemoveAction, gameState);
|
||||
|
||||
if (res.Error == Status::Ok)
|
||||
if (res.Error == Status::ok)
|
||||
{
|
||||
totalCost += res.Cost;
|
||||
tileEdited = executing;
|
||||
}
|
||||
else if (res.Error == Status::InsufficientFunds)
|
||||
else if (res.Error == Status::insufficientFunds)
|
||||
{
|
||||
totalCost += res.Cost;
|
||||
}
|
||||
@@ -214,12 +214,12 @@ namespace OpenRCT2::GameActions
|
||||
auto res = executing ? ExecuteNested(&removeSceneryAction, gameState)
|
||||
: QueryNested(&removeSceneryAction, gameState);
|
||||
|
||||
if (res.Error == Status::Ok)
|
||||
if (res.Error == Status::ok)
|
||||
{
|
||||
totalCost += res.Cost;
|
||||
tileEdited = executing;
|
||||
}
|
||||
else if (res.Error == Status::InsufficientFunds)
|
||||
else if (res.Error == Status::insufficientFunds)
|
||||
{
|
||||
totalCost += res.Cost;
|
||||
}
|
||||
|
||||
@@ -58,36 +58,36 @@ namespace OpenRCT2::GameActions
|
||||
res.Position = _loc;
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
if (_loc.z < kFootpathMinHeight)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_LOW);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_LOW);
|
||||
}
|
||||
|
||||
if (_loc.z > kFootpathMaxHeight)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_HIGH);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_HIGH);
|
||||
}
|
||||
|
||||
auto tileElement = MapGetFootpathElement(_loc);
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto pathElement = tileElement->AsPath();
|
||||
if (pathElement->IsLevelCrossing(_loc))
|
||||
{
|
||||
return Result(
|
||||
Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANNOT_BUILD_PATH_ADDITIONS_ON_LEVEL_CROSSINGS);
|
||||
Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANNOT_BUILD_PATH_ADDITIONS_ON_LEVEL_CROSSINGS);
|
||||
}
|
||||
|
||||
// No change
|
||||
@@ -101,29 +101,29 @@ namespace OpenRCT2::GameActions
|
||||
if (pathAdditionEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Unknown footpath addition entry for entryIndex %d", _entryIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
uint16_t sceneryFlags = pathAdditionEntry->flags;
|
||||
|
||||
if ((sceneryFlags & PATH_ADDITION_FLAG_DONT_ALLOW_ON_SLOPE) && pathElement->IsSloped())
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_ON_SLOPED_FOOTPATH);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_ON_SLOPED_FOOTPATH);
|
||||
}
|
||||
|
||||
if ((sceneryFlags & PATH_ADDITION_FLAG_DONT_ALLOW_ON_QUEUE) && pathElement->IsQueue())
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANNOT_PLACE_THESE_ON_QUEUE_LINE_AREA);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CANNOT_PLACE_THESE_ON_QUEUE_LINE_AREA);
|
||||
}
|
||||
|
||||
if (!(sceneryFlags & (PATH_ADDITION_FLAG_JUMPING_FOUNTAIN_WATER | PATH_ADDITION_FLAG_JUMPING_FOUNTAIN_SNOW))
|
||||
&& (pathElement->GetEdges()) == 0x0F)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_PLACED_ON_PATH_EDGES);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_PLACED_ON_PATH_EDGES);
|
||||
}
|
||||
|
||||
if ((sceneryFlags & PATH_ADDITION_FLAG_IS_QUEUE_SCREEN) && !pathElement->IsQueue())
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_PLACE_THESE_ON_QUEUE_AREA);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_PLACE_THESE_ON_QUEUE_AREA);
|
||||
}
|
||||
|
||||
res.Cost = pathAdditionEntry->price;
|
||||
@@ -134,7 +134,7 @@ namespace OpenRCT2::GameActions
|
||||
// Check if there is something on the path already
|
||||
if (pathElement->HasAddition())
|
||||
{
|
||||
return Result(Status::ItemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, kStringIdNone);
|
||||
return Result(Status::itemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, kStringIdNone);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
@@ -152,7 +152,7 @@ namespace OpenRCT2::GameActions
|
||||
if (pathElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
// No change
|
||||
@@ -166,7 +166,7 @@ namespace OpenRCT2::GameActions
|
||||
if (pathAdditionEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Unknown footpath addition entry for entryIndex %d", _entryIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
res.Cost = pathAdditionEntry->price;
|
||||
|
||||
@@ -50,42 +50,42 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::disallowed, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
if (_loc.z < kFootpathMinHeight)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_TOO_LOW);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_TOO_LOW);
|
||||
}
|
||||
|
||||
if (_loc.z > kFootpathMaxHeight)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_TOO_HIGH);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_TOO_HIGH);
|
||||
}
|
||||
|
||||
auto tileElement = MapGetFootpathElement(_loc);
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto pathElement = tileElement->AsPath();
|
||||
if (pathElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (!pathElement->AdditionIsGhost() && (GetFlags().has(CommandFlag::ghost)))
|
||||
{
|
||||
LOG_WARNING("Tried to remove non ghost during ghost removal.");
|
||||
return Result(Status::Disallowed, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
return Result(Status::disallowed, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
}
|
||||
auto res = Result();
|
||||
res.Position = _loc;
|
||||
@@ -104,7 +104,7 @@ namespace OpenRCT2::GameActions
|
||||
if (pathElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
pathElement->SetAddition(0);
|
||||
|
||||
@@ -76,22 +76,22 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc) || MapIsEdge(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
if (_loc.z < kFootpathMinHeight)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_LOW);
|
||||
return Result(Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_LOW);
|
||||
}
|
||||
|
||||
if (_loc.z > kFootpathMaxHeight)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH);
|
||||
return Result(Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH);
|
||||
}
|
||||
|
||||
return ElementInsertQuery(std::move(res));
|
||||
@@ -124,7 +124,7 @@ namespace OpenRCT2::GameActions
|
||||
if (!MapCheckCapacityAndReorganise(_loc))
|
||||
{
|
||||
return Result(
|
||||
Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
Status::noFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
||||
res.Cost = 12.00_GBP;
|
||||
@@ -156,7 +156,7 @@ namespace OpenRCT2::GameActions
|
||||
: CreateCrossingMode::pathOverTrack;
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ _loc, zLow, zHigh }, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat, crossingMode);
|
||||
if (!entrancePath && canBuild.Error != Status::Ok)
|
||||
if (!entrancePath && canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
return canBuild;
|
||||
@@ -168,14 +168,14 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!getGameState().cheats.disableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
|
||||
return Result(Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
|
||||
}
|
||||
|
||||
auto surfaceElement = MapGetSurfaceElementAt(_loc);
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
return Result(
|
||||
Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
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 / kPathHeightStep) * 5.00_GBP;
|
||||
@@ -226,7 +226,7 @@ namespace OpenRCT2::GameActions
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ _loc, zLow, zHigh }, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags().with(CommandFlag::apply),
|
||||
kTileSlopeFlat, crossingMode);
|
||||
if (!entrancePath && canBuild.Error != Status::Ok)
|
||||
if (!entrancePath && canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
return canBuild;
|
||||
@@ -240,7 +240,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
return Result(
|
||||
Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
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 / kPathHeightStep) * 5.00_GBP;
|
||||
|
||||
@@ -85,33 +85,33 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc) || MapIsEdge(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
if (_slope.type == FootpathSlopeType::irregular || _slope.type == FootpathSlopeType::raise)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_SLOPE_UNSUITABLE);
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_SLOPE_UNSUITABLE);
|
||||
}
|
||||
|
||||
if (_loc.z < kFootpathMinHeight)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_TOO_LOW);
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_TOO_LOW);
|
||||
}
|
||||
|
||||
if (_loc.z > kFootpathMaxHeight)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_TOO_HIGH);
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_TOO_HIGH);
|
||||
}
|
||||
|
||||
if (_direction != kInvalidDirection && !DirectionValid(_direction))
|
||||
{
|
||||
LOG_ERROR("Direction invalid. direction = %u", _direction);
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
auto intent = Intent(INTENT_ACTION_REMOVE_PROVISIONAL_FOOTPATH);
|
||||
@@ -215,7 +215,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (_constructFlags & PathConstructFlag::IsQueue && pathElement->IsLevelCrossing(_loc))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_QUEUE_PATHS_CANNOT_BE_USED_FOR_LEVEL_CROSSINGS);
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_QUEUE_PATHS_CANNOT_BE_USED_FOR_LEVEL_CROSSINGS);
|
||||
}
|
||||
|
||||
if (!IsSameAsPathElement(pathElement))
|
||||
@@ -225,7 +225,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (GetFlags().has(CommandFlag::ghost) && !pathElement->IsGhost())
|
||||
{
|
||||
return Result(Status::ItemAlreadyPlaced, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone);
|
||||
return Result(Status::itemAlreadyPlaced, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!MapCheckCapacityAndReorganise(_loc))
|
||||
{
|
||||
return Result(Status::NoFreeElements, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone);
|
||||
return Result(Status::noFreeElements, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
res.Cost = 12.00_GBP;
|
||||
@@ -321,7 +321,7 @@ namespace OpenRCT2::GameActions
|
||||
: CreateCrossingMode::pathOverTrack;
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ _loc, zLow, zHigh }, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat, crossingMode);
|
||||
if (!entrancePath && canBuild.Error != Status::Ok)
|
||||
if (!entrancePath && canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = STR_CANT_BUILD_FOOTPATH_HERE;
|
||||
return canBuild;
|
||||
@@ -333,13 +333,13 @@ namespace OpenRCT2::GameActions
|
||||
gFootpathGroundFlags = clearanceData.GroundFlags;
|
||||
if (!getGameState().cheats.disableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
|
||||
}
|
||||
|
||||
auto surfaceElement = MapGetSurfaceElementAt(_loc);
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(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 / kPathHeightStep) * 5.00_GBP;
|
||||
@@ -390,7 +390,7 @@ namespace OpenRCT2::GameActions
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ _loc, zLow, zHigh }, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags().with(CommandFlag::apply),
|
||||
kTileSlopeFlat, crossingMode);
|
||||
if (!entrancePath && canBuild.Error != Status::Ok)
|
||||
if (!entrancePath && canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = STR_CANT_BUILD_FOOTPATH_HERE;
|
||||
return canBuild;
|
||||
@@ -403,7 +403,7 @@ namespace OpenRCT2::GameActions
|
||||
auto surfaceElement = MapGetSurfaceElementAt(_loc);
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(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 / kPathHeightStep) * 5.00_GBP;
|
||||
|
||||
@@ -57,18 +57,18 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (!(gLegacyScene == LegacyScene::scenarioEditor || getGameState().cheats.sandboxMode) && !MapIsLocationOwned(_loc))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
TileElement* footpathElement = GetFootpathElement();
|
||||
if (footpathElement == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
res.Cost = GetRefundPrice(footpathElement);
|
||||
@@ -94,7 +94,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
FootpathQueueChainReset();
|
||||
auto bannerRes = RemoveBannersAtElement(gameState, _loc, footpathElement);
|
||||
if (bannerRes.Error == Status::Ok)
|
||||
if (bannerRes.Error == Status::ok)
|
||||
{
|
||||
res.Cost += bannerRes.Cost;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
else
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
res.Cost += GetRefundPrice(footpathElement);
|
||||
@@ -174,7 +174,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
auto res = ExecuteNested(&bannerRemoveAction, gameState);
|
||||
// Ghost removal is free
|
||||
if (res.Error == Status::Ok && !isGhost)
|
||||
if (res.Error == Status::ok && !isGhost)
|
||||
{
|
||||
result.Cost += res.Cost;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenRCT2::GameActions
|
||||
Guard::Assert(action != nullptr);
|
||||
|
||||
Result result = Execute(action, getGameState());
|
||||
if (result.Error == Status::Ok && Network::GetMode() == Network::Mode::server)
|
||||
if (result.Error == Status::ok && Network::GetMode() == Network::Mode::server)
|
||||
{
|
||||
// Relay this action to all other clients.
|
||||
Network::SendGameAction(action);
|
||||
@@ -197,7 +197,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
Result result = Result();
|
||||
|
||||
result.Error = Status::GamePaused;
|
||||
result.Error = Status::gamePaused;
|
||||
result.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
result.ErrorMessage = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
|
||||
@@ -206,11 +206,11 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
auto result = action->Query(gameState);
|
||||
|
||||
if (result.Error == Status::Ok)
|
||||
if (result.Error == Status::ok)
|
||||
{
|
||||
if (!FinanceCheckAffordability(result.Cost, action->GetFlags()))
|
||||
{
|
||||
result.Error = Status::InsufficientFunds;
|
||||
result.Error = Status::insufficientFunds;
|
||||
result.ErrorTitle = STR_CANT_DO_THIS;
|
||||
result.ErrorMessage = STR_NOT_ENOUGH_CASH_REQUIRES;
|
||||
Formatter(result.ErrorMessageArgs.data()).Add<uint32_t>(result.Cost);
|
||||
@@ -266,7 +266,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
char temp[128] = {};
|
||||
|
||||
if (result.Error != Status::Ok)
|
||||
if (result.Error != Status::ok)
|
||||
{
|
||||
snprintf(temp, sizeof(temp), ") Failed, %u", static_cast<uint32_t>(result.Error));
|
||||
}
|
||||
@@ -301,7 +301,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
// TODO: Introduce proper error.
|
||||
auto result = Result();
|
||||
result.Error = Status::GamePaused;
|
||||
result.Error = Status::gamePaused;
|
||||
result.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
result.ErrorMessage = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
|
||||
@@ -311,14 +311,14 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
Result result = QueryInternal(action, gameState, topLevel);
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
if (result.Error == Status::Ok && ((Network::GetMode() == Network::Mode::none) || flags.has(CommandFlag::networked)))
|
||||
if (result.Error == Status::ok && ((Network::GetMode() == Network::Mode::none) || flags.has(CommandFlag::networked)))
|
||||
{
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
scriptEngine.RunGameActionHooks(*action, result, false);
|
||||
// Script hooks may now have changed the game action result...
|
||||
}
|
||||
#endif
|
||||
if (result.Error == Status::Ok)
|
||||
if (result.Error == Status::ok)
|
||||
{
|
||||
if (topLevel)
|
||||
{
|
||||
@@ -355,7 +355,7 @@ namespace OpenRCT2::GameActions
|
||||
// Execute the action, changing the game state
|
||||
result = action->Execute(gameState);
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
if (result.Error == Status::Ok)
|
||||
if (result.Error == Status::ok)
|
||||
{
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
scriptEngine.RunGameActionHooks(*action, result, true);
|
||||
@@ -370,13 +370,13 @@ namespace OpenRCT2::GameActions
|
||||
return result;
|
||||
|
||||
// Update money balance
|
||||
if (result.Error == Status::Ok && FinanceCheckMoneyRequired(flags) && result.Cost != 0)
|
||||
if (result.Error == Status::ok && FinanceCheckMoneyRequired(flags) && result.Cost != 0)
|
||||
{
|
||||
FinancePayment(result.Cost, result.Expenditure);
|
||||
MoneyEffect::Create(result.Cost, result.Position);
|
||||
}
|
||||
|
||||
if (!(actionFlags & Flags::ClientOnly) && result.Error == Status::Ok)
|
||||
if (!(actionFlags & Flags::ClientOnly) && result.Error == Status::ok)
|
||||
{
|
||||
if (Network::GetMode() != Network::Mode::none)
|
||||
{
|
||||
@@ -446,7 +446,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
}
|
||||
|
||||
if (result.Error != Status::Ok && shouldShowError)
|
||||
if (result.Error != Status::ok && shouldShowError)
|
||||
{
|
||||
auto windowManager = Ui::GetWindowManager();
|
||||
windowManager->ShowError(result.GetErrorTitle(), result.GetErrorMessage());
|
||||
|
||||
@@ -28,25 +28,25 @@ namespace OpenRCT2::GameActions
|
||||
*/
|
||||
enum class Status : uint16_t
|
||||
{
|
||||
Ok,
|
||||
InvalidParameters,
|
||||
Disallowed,
|
||||
GamePaused,
|
||||
InsufficientFunds,
|
||||
NotInEditorMode,
|
||||
ok,
|
||||
invalidParameters,
|
||||
disallowed,
|
||||
gamePaused,
|
||||
insufficientFunds,
|
||||
notInEditorMode,
|
||||
|
||||
NotOwned,
|
||||
TooLow,
|
||||
TooHigh,
|
||||
NoClearance,
|
||||
ItemAlreadyPlaced,
|
||||
notOwned,
|
||||
tooLow,
|
||||
tooHigh,
|
||||
noClearance,
|
||||
itemAlreadyPlaced,
|
||||
|
||||
NotClosed,
|
||||
Broken,
|
||||
notClosed,
|
||||
broken,
|
||||
|
||||
NoFreeElements,
|
||||
noFreeElements,
|
||||
|
||||
Unknown = std::numeric_limits<std::underlying_type_t<Status>>::max(),
|
||||
unknown = std::numeric_limits<std::underlying_type_t<Status>>::max(),
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -57,7 +57,7 @@ namespace OpenRCT2::GameActions
|
||||
public:
|
||||
using StringVariant = std::variant<std::string, StringId>;
|
||||
|
||||
Status Error = Status::Ok;
|
||||
Status Error = Status::ok;
|
||||
StringVariant ErrorTitle = kStringIdNone;
|
||||
StringVariant ErrorMessage = kStringIdNone;
|
||||
std::array<uint8_t, 32> ErrorMessageArgs{};
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRCT2::GameActions
|
||||
if (!IsValidSpeed(_speed))
|
||||
{
|
||||
LOG_ERROR("Invalid speed %u", _speed);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -57,7 +57,7 @@ namespace OpenRCT2::GameActions
|
||||
if (!IsValidSpeed(_speed))
|
||||
{
|
||||
LOG_ERROR("Invalid speed %u", _speed);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
gGameSpeed = _speed;
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace OpenRCT2::GameActions
|
||||
if (peep == nullptr)
|
||||
{
|
||||
LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone);
|
||||
}
|
||||
return Result();
|
||||
}
|
||||
@@ -58,7 +58,7 @@ namespace OpenRCT2::GameActions
|
||||
if (peep == nullptr)
|
||||
{
|
||||
LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
peep->PeepFlags = _newFlags;
|
||||
|
||||
@@ -60,14 +60,14 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull())
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_NAME_GUEST, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
auto guest = getGameState().entities.TryGetEntity<Guest>(_spriteIndex);
|
||||
if (guest == nullptr)
|
||||
{
|
||||
LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_NAME_GUEST, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_NAME_GUEST, kStringIdNone);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -79,7 +79,7 @@ namespace OpenRCT2::GameActions
|
||||
if (guest == nullptr)
|
||||
{
|
||||
LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_NAME_GUEST, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_NAME_GUEST, kStringIdNone);
|
||||
}
|
||||
|
||||
auto curName = guest->GetName();
|
||||
@@ -90,7 +90,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!guest->SetName(_name))
|
||||
{
|
||||
return Result(Status::Unknown, STR_CANT_NAME_GUEST, kStringIdNone);
|
||||
return Result(Status::unknown, STR_CANT_NAME_GUEST, kStringIdNone);
|
||||
}
|
||||
|
||||
// Easter egg functions are for guests only
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace OpenRCT2::GameActions
|
||||
if (!LocationValid({ x, y }))
|
||||
continue;
|
||||
auto result = MapBuyLandRightsForTile({ x, y }, isExecuting);
|
||||
if (result.Error == Status::Ok)
|
||||
if (result.Error == Status::ok)
|
||||
{
|
||||
res.Cost += result.Cost;
|
||||
}
|
||||
@@ -114,14 +114,14 @@ namespace OpenRCT2::GameActions
|
||||
if (_setting >= LandBuyRightSetting::Count)
|
||||
{
|
||||
LOG_ERROR("Invalid land buying setting %u", _setting);
|
||||
return Result(Status::InvalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc);
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No surface at x = %d, y = %d", loc.x, loc.y);
|
||||
return Result(Status::InvalidParameters, kErrorTitles[EnumValue(_setting)], STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, kErrorTitles[EnumValue(_setting)], STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -135,7 +135,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (gLegacyScene == LegacyScene::scenarioEditor || (surfaceElement->GetOwnership() & OWNERSHIP_AVAILABLE) == 0)
|
||||
{
|
||||
return Result(Status::NotOwned, kErrorTitles[EnumValue(_setting)], STR_LAND_NOT_FOR_SALE);
|
||||
return Result(Status::notOwned, kErrorTitles[EnumValue(_setting)], STR_LAND_NOT_FOR_SALE);
|
||||
}
|
||||
if (isExecuting)
|
||||
{
|
||||
@@ -154,7 +154,7 @@ namespace OpenRCT2::GameActions
|
||||
if (gLegacyScene == LegacyScene::scenarioEditor
|
||||
|| (surfaceElement->GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) == 0)
|
||||
{
|
||||
return Result(Status::NotOwned, kErrorTitles[EnumValue(_setting)], STR_CONSTRUCTION_RIGHTS_NOT_FOR_SALE);
|
||||
return Result(Status::notOwned, kErrorTitles[EnumValue(_setting)], STR_CONSTRUCTION_RIGHTS_NOT_FOR_SALE);
|
||||
}
|
||||
|
||||
if (isExecuting)
|
||||
@@ -168,7 +168,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
default:
|
||||
LOG_ERROR("Invalid land buying setting %u", _setting);
|
||||
return Result(Status::InvalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
}
|
||||
} // namespace OpenRCT2::GameActions
|
||||
@@ -127,7 +127,7 @@ namespace OpenRCT2::GameActions
|
||||
landSetHeightAction.SetFlags(GetFlags());
|
||||
auto result = isExecuting ? ExecuteNested(&landSetHeightAction, gameState)
|
||||
: QueryNested(&landSetHeightAction, gameState);
|
||||
if (result.Error == Status::Ok)
|
||||
if (result.Error == Status::ok)
|
||||
{
|
||||
res.Cost += result.Cost;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!withinOwnership)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_LOWER_LAND_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::disallowed, STR_CANT_LOWER_LAND_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
// Force ride construction to recheck area
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace OpenRCT2::GameActions
|
||||
landSetHeightAction.SetFlags(GetFlags());
|
||||
auto result = isExecuting ? ExecuteNested(&landSetHeightAction, gameState)
|
||||
: QueryNested(&landSetHeightAction, gameState);
|
||||
if (result.Error == Status::Ok)
|
||||
if (result.Error == Status::ok)
|
||||
{
|
||||
res.Cost += result.Cost;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!withinOwnership)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_RAISE_LAND_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::disallowed, STR_CANT_RAISE_LAND_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
// Force ride construction to recheck area
|
||||
|
||||
@@ -62,20 +62,20 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (gameState.park.flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY, kStringIdNone);
|
||||
return Result(Status::disallowed, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY, kStringIdNone);
|
||||
}
|
||||
|
||||
StringId errorMessage = CheckParameters();
|
||||
if (errorMessage != kStringIdNone)
|
||||
{
|
||||
return Result(Status::Disallowed, kStringIdNone, errorMessage);
|
||||
return Result(Status::disallowed, kStringIdNone, errorMessage);
|
||||
}
|
||||
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode)
|
||||
{
|
||||
if (!MapIsLocationInPark(_coords))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK, kStringIdNone);
|
||||
return Result(Status::disallowed, STR_LAND_NOT_OWNED_BY_PARK, kStringIdNone);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace OpenRCT2::GameActions
|
||||
TileElement* tileElement = CheckTreeObstructions();
|
||||
if (tileElement != nullptr)
|
||||
{
|
||||
auto res = Result(Status::Disallowed, kStringIdNone, kStringIdNone);
|
||||
auto res = Result(Status::disallowed, kStringIdNone, kStringIdNone);
|
||||
MapGetObstructionErrorText(tileElement, res);
|
||||
return res;
|
||||
}
|
||||
@@ -102,13 +102,13 @@ namespace OpenRCT2::GameActions
|
||||
errorMessage = CheckRideSupports();
|
||||
if (errorMessage != kStringIdNone)
|
||||
{
|
||||
return Result(Status::Disallowed, kStringIdNone, errorMessage);
|
||||
return Result(Status::disallowed, kStringIdNone, errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
auto* surfaceElement = MapGetSurfaceElementAt(_coords);
|
||||
if (surfaceElement == nullptr)
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
|
||||
// We need to check if there is _currently_ a level crossing on the tile.
|
||||
// For that, we need the old height, so we can't use the _height variable.
|
||||
@@ -116,13 +116,13 @@ namespace OpenRCT2::GameActions
|
||||
auto* pathElement = MapGetFootpathElement(oldCoords);
|
||||
if (pathElement != nullptr && pathElement->AsPath()->IsLevelCrossing(oldCoords))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST, kStringIdNone);
|
||||
return Result(Status::disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST, kStringIdNone);
|
||||
}
|
||||
|
||||
TileElement* tileElement = CheckFloatingStructures(reinterpret_cast<TileElement*>(surfaceElement), _height);
|
||||
if (tileElement != nullptr)
|
||||
{
|
||||
auto res = Result(Status::Disallowed, kStringIdNone, kStringIdNone);
|
||||
auto res = Result(Status::disallowed, kStringIdNone, kStringIdNone);
|
||||
MapGetObstructionErrorText(tileElement, res);
|
||||
return res;
|
||||
}
|
||||
@@ -142,9 +142,9 @@ namespace OpenRCT2::GameActions
|
||||
auto clearResult = MapCanConstructWithClearAt(
|
||||
{ _coords, _height * kCoordsZStep, zCorner * kCoordsZStep }, MapSetLandHeightClearFunc, { 0b1111, 0 }, {},
|
||||
_style, CreateCrossingMode::none);
|
||||
if (clearResult.Error != Status::Ok)
|
||||
if (clearResult.Error != Status::ok)
|
||||
{
|
||||
clearResult.Error = Status::Disallowed;
|
||||
clearResult.Error = Status::disallowed;
|
||||
return clearResult;
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
auto* surfaceElement = MapGetSurfaceElementAt(_coords);
|
||||
if (surfaceElement == nullptr)
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
|
||||
cost += GetSurfaceHeightChangeCost(surfaceElement);
|
||||
SetSurfaceHeight(reinterpret_cast<TileElement*>(surfaceElement));
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!isInEditorMode() && !getGameState().cheats.sandboxMode)
|
||||
{
|
||||
return Result(Status::NotInEditorMode, kStringIdNone, STR_LAND_NOT_FOR_SALE);
|
||||
return Result(Status::notInEditorMode, kStringIdNone, STR_LAND_NOT_FOR_SALE);
|
||||
}
|
||||
|
||||
// Game command modified to accept selection size
|
||||
@@ -99,7 +99,7 @@ namespace OpenRCT2::GameActions
|
||||
if (!LocationValid({ x, y }))
|
||||
continue;
|
||||
auto result = MapBuyLandRightsForTile({ x, y }, isExecuting);
|
||||
if (result.Error == Status::Ok)
|
||||
if (result.Error == Status::ok)
|
||||
{
|
||||
res.Cost += result.Cost;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No surface at x = %d, y = %d", loc.x, loc.y);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -234,7 +234,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
default:
|
||||
LOG_ERROR("Invalid setting %u to set land rights", _setting);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
}
|
||||
} // namespace OpenRCT2::GameActions
|
||||
@@ -238,7 +238,7 @@ namespace OpenRCT2::GameActions
|
||||
landSetHeightAction.SetFlags(GetFlags());
|
||||
auto res = isExecuting ? ExecuteNested(&landSetHeightAction, gameState)
|
||||
: QueryNested(&landSetHeightAction, gameState);
|
||||
if (res.Error == Status::Ok)
|
||||
if (res.Error == Status::ok)
|
||||
{
|
||||
totalCost += res.Cost;
|
||||
}
|
||||
@@ -326,7 +326,7 @@ namespace OpenRCT2::GameActions
|
||||
expectedLandHeight += landChangePerTile;
|
||||
// change land of current tile
|
||||
auto result = SmoothLandTile(gameState, direction, isExecuting, nextLoc, surfaceElement);
|
||||
if (result.Error == Status::Ok)
|
||||
if (result.Error == Status::ok)
|
||||
{
|
||||
totalCost += result.Cost;
|
||||
}
|
||||
@@ -642,7 +642,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
default:
|
||||
LOG_ERROR("Invalid map selection type %u", _selectionType);
|
||||
return Result(Status::InvalidParameters, std::get<StringId>(res.ErrorTitle), STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, std::get<StringId>(res.ErrorTitle), STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
} // switch selectionType
|
||||
|
||||
// Raise / lower the land tool selection area
|
||||
@@ -659,7 +659,7 @@ namespace OpenRCT2::GameActions
|
||||
lowerLandAction.SetFlags(GetFlags());
|
||||
result = isExecuting ? ExecuteNested(&lowerLandAction, gameState) : QueryNested(&lowerLandAction, gameState);
|
||||
}
|
||||
if (result.Error != Status::Ok)
|
||||
if (result.Error != Status::ok)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -81,29 +81,29 @@ namespace OpenRCT2::GameActions
|
||||
if (_primaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
LOG_ERROR("Invalid primary colour %u", _primaryColour);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
else if (_secondaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
LOG_ERROR("Invalid secondary colour %u", _secondaryColour);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
else if (_tertiaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
else if (_sceneryType >= kMaxLargeSceneryObjects)
|
||||
{
|
||||
LOG_ERROR("Invalid sceneryType %u", _sceneryType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
auto* sceneryEntry = ObjectManager::GetObjectEntry<LargeSceneryEntry>(_sceneryType);
|
||||
if (sceneryEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Large scenery entry not found for sceneryType %u", _sceneryType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
const auto totalNumTiles = sceneryEntry->tiles.size();
|
||||
@@ -121,7 +121,7 @@ namespace OpenRCT2::GameActions
|
||||
if (HasReachedBannerLimit())
|
||||
{
|
||||
LOG_ERROR("No free banners available");
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace OpenRCT2::GameActions
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ curTile, zLow, zHigh }, MapPlaceSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat,
|
||||
CreateCrossingMode::none, isTree);
|
||||
if (canBuild.Error != Status::Ok)
|
||||
if (canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = STR_CANT_POSITION_THIS_HERE;
|
||||
return canBuild;
|
||||
@@ -154,12 +154,12 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if ((clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) || (clearanceData.GroundFlags & ELEMENT_IS_UNDERGROUND))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
|
||||
return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
|
||||
}
|
||||
if (resultData.GroundFlags && !(resultData.GroundFlags & tempSceneryGroundFlags))
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND);
|
||||
Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,20 +167,20 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(curTile) || MapIsEdge(curTile))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !MapIsLocationOwned({ curTile, zLow })
|
||||
&& !gameState.cheats.sandboxMode)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
}
|
||||
|
||||
if (!CheckMapCapacity(sceneryEntry->tiles, totalNumTiles))
|
||||
{
|
||||
LOG_ERROR("No free map elements available");
|
||||
return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
||||
// Force ride construction to recheck area
|
||||
@@ -211,13 +211,13 @@ namespace OpenRCT2::GameActions
|
||||
if (sceneryEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Large scenery entry not found for sceneryType = %u", _sceneryType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
if (sceneryEntry->tiles.empty())
|
||||
{
|
||||
LOG_ERROR("Invalid large scenery object, sceneryType = %u", _sceneryType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
int16_t maxHeight = GetMaxSurfaceHeight(sceneryEntry->tiles);
|
||||
@@ -237,7 +237,7 @@ namespace OpenRCT2::GameActions
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("No free banners available");
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
|
||||
banner->text = {};
|
||||
@@ -272,7 +272,7 @@ namespace OpenRCT2::GameActions
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ curTile, zLow, zHigh }, MapPlaceSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat,
|
||||
CreateCrossingMode::none, isTree);
|
||||
if (canBuild.Error != Status::Ok)
|
||||
if (canBuild.Error != Status::ok)
|
||||
{
|
||||
if (banner != nullptr)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenRCT2::GameActions
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No large scenery element to remove at x = %d, y = %d", _loc.x, _loc.y);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
}
|
||||
|
||||
auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry();
|
||||
@@ -73,7 +73,7 @@ namespace OpenRCT2::GameActions
|
||||
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 Result(Status::Unknown, STR_CANT_REMOVE_THIS, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::unknown, STR_CANT_REMOVE_THIS, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
auto rotatedOffsets = CoordsXYZ{ CoordsXY{ sceneryEntry->tiles[_tileIndex].offset }.Rotate(_loc.direction),
|
||||
@@ -94,7 +94,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (sceneryEntry->HasFlag(LARGE_SCENERY_FLAG_IS_TREE))
|
||||
{
|
||||
res.Error = Status::NoClearance;
|
||||
res.Error = Status::noClearance;
|
||||
res.ErrorTitle = STR_CANT_REMOVE_THIS;
|
||||
res.ErrorMessage = STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY;
|
||||
return res;
|
||||
@@ -103,13 +103,13 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!MapIsLocationOwned({ currentTile.x, currentTile.y, currentTile.z }))
|
||||
{
|
||||
return Result(Status::NoClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::noClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
}
|
||||
|
||||
if (!LocationValid(currentTile))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
// Prevent duplicate costs when using the clear scenery tool that overlaps multiple large
|
||||
// scenery tile elements.
|
||||
@@ -143,7 +143,7 @@ namespace OpenRCT2::GameActions
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No large scenery element to remove at %d, y = %d", _loc.x, _loc.y);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
}
|
||||
|
||||
auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry();
|
||||
@@ -151,7 +151,7 @@ namespace OpenRCT2::GameActions
|
||||
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 Result(Status::Unknown, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
return Result(Status::unknown, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
tileElement->RemoveBannerEntry();
|
||||
@@ -171,7 +171,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (!MapIsLocationOwned({ currentTile.x, currentTile.y, currentTile.z }))
|
||||
{
|
||||
return Result(Status::NoClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::noClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,23 +75,23 @@ namespace OpenRCT2::GameActions
|
||||
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 Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
if (_primaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
LOG_ERROR("Invalid primary colour %u", _primaryColour);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
else if (_secondaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
LOG_ERROR("Invalid secondary colour %u", _secondaryColour);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
else if (_tertiaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
|
||||
auto largeElement = MapGetLargeScenerySegment(_loc, _tileIndex);
|
||||
@@ -101,7 +101,7 @@ namespace OpenRCT2::GameActions
|
||||
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 Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
if ((GetFlags().has(CommandFlag::ghost)) && !(largeElement->IsGhost()))
|
||||
@@ -114,7 +114,7 @@ namespace OpenRCT2::GameActions
|
||||
if (sceneryEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Scenery element doesn't have scenery entry");
|
||||
return Result(Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::unknown, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
// Work out the base tile coordinates (Tile with index 0)
|
||||
auto rotatedBaseCoordsOffset = CoordsXYZ{ CoordsXY{ sceneryEntry->tiles[_tileIndex].offset }.Rotate(_loc.direction),
|
||||
@@ -132,13 +132,13 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (!MapIsLocationOwned(currentTile))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
}
|
||||
|
||||
if (!LocationValid(currentTile))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
auto tileElement = MapGetLargeScenerySegment({ currentTile.x, currentTile.y, _loc.z, _loc.direction }, tile.index);
|
||||
@@ -148,7 +148,7 @@ namespace OpenRCT2::GameActions
|
||||
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 Result(Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::unknown, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
if (isExecuting)
|
||||
{
|
||||
|
||||
@@ -47,11 +47,11 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (_targetSize.x > kMaximumMapSizeTechnical || _targetSize.y > kMaximumMapSizeTechnical)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
if (_targetSize.x < kMinimumMapSizeTechnical || _targetSize.y < kMinimumMapSizeTechnical)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
return Result();
|
||||
}
|
||||
|
||||
@@ -55,35 +55,35 @@ namespace OpenRCT2::GameActions
|
||||
res.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
if ((_loc.z & 0xF) != 0)
|
||||
{
|
||||
res.Error = Status::Unknown;
|
||||
res.Error = Status::unknown;
|
||||
res.ErrorMessage = STR_INVALID_HEIGHT;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
res.Error = Status::InvalidParameters;
|
||||
res.Error = Status::invalidParameters;
|
||||
res.ErrorMessage = STR_OFF_EDGE_OF_MAP;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (!MapIsLocationOwned(_loc) && !gameState.cheats.sandboxMode)
|
||||
{
|
||||
res.Error = Status::NotOwned;
|
||||
res.Error = Status::notOwned;
|
||||
res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (!MapCheckCapacityAndReorganise(_loc))
|
||||
{
|
||||
res.Error = Status::NoFreeElements;
|
||||
res.Error = Status::noFreeElements;
|
||||
res.ErrorMessage = STR_TILE_ELEMENT_LIMIT_REACHED;
|
||||
return res;
|
||||
}
|
||||
auto surfaceElement = MapGetSurfaceElementAt(_loc);
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
res.Error = Status::Unknown;
|
||||
res.Error = Status::unknown;
|
||||
res.ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS;
|
||||
return res;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ namespace OpenRCT2::GameActions
|
||||
const auto& rtd = ride->getRideTypeDescriptor();
|
||||
if (heightDifference > rtd.Heights.MaxHeight)
|
||||
{
|
||||
res.Error = Status::TooHigh;
|
||||
res.Error = Status::tooHigh;
|
||||
res.ErrorMessage = STR_TOO_HIGH_FOR_SUPPORTS;
|
||||
return res;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ namespace OpenRCT2::GameActions
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ _loc.ToTileStart(), baseHeight, clearanceHeight }, MapPlaceNonSceneryClearFunc, { 0b1111, 0 }, GetFlags(),
|
||||
kTileSlopeFlat);
|
||||
if (canBuild.Error != Status::Ok)
|
||||
if (canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
return canBuild;
|
||||
@@ -118,14 +118,14 @@ namespace OpenRCT2::GameActions
|
||||
const auto clearanceData = canBuild.GetData<ConstructClearResult>();
|
||||
if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)
|
||||
{
|
||||
res.Error = Status::NoClearance;
|
||||
res.Error = Status::noClearance;
|
||||
res.ErrorMessage = STR_RIDE_CANT_BUILD_THIS_UNDERWATER;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (clearanceData.GroundFlags & ELEMENT_IS_UNDERGROUND)
|
||||
{
|
||||
res.Error = Status::NoClearance;
|
||||
res.Error = Status::noClearance;
|
||||
res.ErrorMessage = STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND;
|
||||
return res;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr || ride->type == kRideTypeNull)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex);
|
||||
res.Error = Status::InvalidParameters;
|
||||
res.Error = Status::invalidParameters;
|
||||
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
|
||||
return res;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex);
|
||||
res.Error = Status::InvalidParameters;
|
||||
res.Error = Status::invalidParameters;
|
||||
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
|
||||
return res;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ namespace OpenRCT2::GameActions
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ _loc.ToTileStart(), baseHeight, clearanceHeight }, MapPlaceNonSceneryClearFunc, { 0b1111, 0 },
|
||||
GetFlags().with(CommandFlag::apply), kTileSlopeFlat);
|
||||
if (canBuild.Error != Status::Ok)
|
||||
if (canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
return canBuild;
|
||||
|
||||
@@ -89,35 +89,35 @@ namespace OpenRCT2::GameActions
|
||||
res.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
if ((_loc.z & 0xF) != 0 && _mode == GC_SET_MAZE_TRACK_BUILD)
|
||||
{
|
||||
res.Error = Status::Unknown;
|
||||
res.Error = Status::unknown;
|
||||
res.ErrorMessage = STR_INVALID_HEIGHT;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
res.Error = Status::InvalidParameters;
|
||||
res.Error = Status::invalidParameters;
|
||||
res.ErrorMessage = STR_OFF_EDGE_OF_MAP;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (!MapIsLocationOwned(_loc) && !gameState.cheats.sandboxMode)
|
||||
{
|
||||
res.Error = Status::NotOwned;
|
||||
res.Error = Status::notOwned;
|
||||
res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (!MapCheckCapacityAndReorganise(_loc))
|
||||
{
|
||||
res.Error = Status::NoFreeElements;
|
||||
res.Error = Status::noFreeElements;
|
||||
res.ErrorMessage = STR_TILE_ELEMENT_LIMIT_REACHED;
|
||||
return res;
|
||||
}
|
||||
auto surfaceElement = MapGetSurfaceElementAt(_loc);
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
res.Error = Status::Unknown;
|
||||
res.Error = Status::unknown;
|
||||
res.ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS;
|
||||
return res;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ namespace OpenRCT2::GameActions
|
||||
const auto& rtd = ride->getRideTypeDescriptor();
|
||||
if (heightDifference > rtd.Heights.MaxHeight)
|
||||
{
|
||||
res.Error = Status::TooHigh;
|
||||
res.Error = Status::tooHigh;
|
||||
res.ErrorMessage = STR_TOO_HIGH_FOR_SUPPORTS;
|
||||
return res;
|
||||
}
|
||||
@@ -145,12 +145,12 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (_mode != GC_SET_MAZE_TRACK_BUILD)
|
||||
{
|
||||
res.Error = Status::Unknown;
|
||||
res.Error = Status::unknown;
|
||||
res.ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS;
|
||||
return res;
|
||||
}
|
||||
auto constructResult = MapCanConstructAt({ _loc.ToTileStart(), baseHeight, clearanceHeight }, { 0b1111, 0 });
|
||||
if (constructResult.Error != Status::Ok)
|
||||
if (constructResult.Error != Status::ok)
|
||||
{
|
||||
constructResult.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
return constructResult;
|
||||
@@ -159,14 +159,14 @@ namespace OpenRCT2::GameActions
|
||||
const auto clearanceData = constructResult.GetData<ConstructClearResult>();
|
||||
if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)
|
||||
{
|
||||
res.Error = Status::NoClearance;
|
||||
res.Error = Status::noClearance;
|
||||
res.ErrorMessage = STR_RIDE_CANT_BUILD_THIS_UNDERWATER;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (clearanceData.GroundFlags & ELEMENT_IS_UNDERGROUND)
|
||||
{
|
||||
res.Error = Status::NoClearance;
|
||||
res.Error = Status::noClearance;
|
||||
res.ErrorMessage = STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND;
|
||||
return res;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr || !RideTypeIsValid(ride->type))
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex);
|
||||
res.Error = Status::NoClearance;
|
||||
res.Error = Status::noClearance;
|
||||
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
|
||||
return res;
|
||||
}
|
||||
@@ -200,7 +200,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex);
|
||||
res.Error = Status::InvalidParameters;
|
||||
res.Error = Status::invalidParameters;
|
||||
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
|
||||
return res;
|
||||
}
|
||||
@@ -294,7 +294,7 @@ namespace OpenRCT2::GameActions
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No surface found");
|
||||
res.Error = Status::Unknown;
|
||||
res.Error = Status::unknown;
|
||||
res.ErrorMessage = STR_ERR_SURFACE_ELEMENT_NOT_FOUND;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (!isInEditorMode() && !getGameState().cheats.sandboxMode)
|
||||
{
|
||||
return Result(Status::NotInEditorMode, STR_CANT_BUILD_THIS_HERE, kStringIdNone);
|
||||
return Result(Status::notInEditorMode, STR_CANT_BUILD_THIS_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -72,17 +72,17 @@ namespace OpenRCT2::GameActions
|
||||
if (!LocationValid(_loc) || _loc.x <= kCoordsXYStep || _loc.y <= kCoordsXYStep || _loc.x >= mapSizeUnits.x
|
||||
|| _loc.y >= mapSizeUnits.y)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_CLOSE_TO_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_CLOSE_TO_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (!CheckMapCapacity(3))
|
||||
{
|
||||
return Result(Status::NoFreeElements, STR_CANT_BUILD_THIS_HERE, STR_ERR_LANDSCAPE_DATA_AREA_FULL);
|
||||
return Result(Status::noFreeElements, STR_CANT_BUILD_THIS_HERE, STR_ERR_LANDSCAPE_DATA_AREA_FULL);
|
||||
}
|
||||
|
||||
if (gameState.park.entrances.size() >= OpenRCT2::Limits::kMaxParkEntrances)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_TOO_MANY_PARK_ENTRANCES);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_TOO_MANY_PARK_ENTRANCES);
|
||||
}
|
||||
|
||||
auto zLow = _loc.z;
|
||||
@@ -100,7 +100,7 @@ namespace OpenRCT2::GameActions
|
||||
entranceLoc.y += CoordsDirectionDelta[(_loc.direction + 1) & 0x3].y * 2;
|
||||
}
|
||||
|
||||
if (auto res2 = MapCanConstructAt({ entranceLoc, zLow, zHigh }, { 0b1111, 0 }); res2.Error != Status::Ok)
|
||||
if (auto res2 = MapCanConstructAt({ entranceLoc, zLow, zHigh }, { 0b1111, 0 }); res2.Error != Status::ok)
|
||||
{
|
||||
res2.ErrorTitle = STR_CANT_BUILD_THIS_HERE;
|
||||
return res2;
|
||||
@@ -110,7 +110,7 @@ namespace OpenRCT2::GameActions
|
||||
EntranceElement* entranceElement = MapGetParkEntranceElementAt(entranceLoc, false);
|
||||
if (entranceElement != nullptr)
|
||||
{
|
||||
return Result(Status::ItemAlreadyPlaced, STR_CANT_BUILD_THIS_HERE, kStringIdNone);
|
||||
return Result(Status::itemAlreadyPlaced, STR_CANT_BUILD_THIS_HERE, kStringIdNone);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (!isInEditorMode() && !getGameState().cheats.sandboxMode)
|
||||
{
|
||||
return Result(Status::NotInEditorMode, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
return Result(Status::notInEditorMode, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -56,12 +56,12 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
if (ParkEntranceGetIndex(_loc) == -1)
|
||||
{
|
||||
LOG_ERROR("No park entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace OpenRCT2::GameActions
|
||||
if (entranceIndex == -1)
|
||||
{
|
||||
LOG_ERROR("No park entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
auto& park = getGameState().park;
|
||||
|
||||
@@ -52,12 +52,12 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (static_cast<size_t>(_type) >= std::size(AdvertisingCampaignPricePerWeek) || _numWeeks >= 256)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_START_MARKETING_CAMPAIGN, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_START_MARKETING_CAMPAIGN, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
if (getGameState().park.flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_CANT_START_MARKETING_CAMPAIGN, STR_MARKETING_CAMPAIGNS_FORBIDDEN_BY_LOCAL_AUTHORITY);
|
||||
Status::disallowed, STR_CANT_START_MARKETING_CAMPAIGN, STR_MARKETING_CAMPAIGNS_FORBIDDEN_BY_LOCAL_AUTHORITY);
|
||||
}
|
||||
|
||||
return CreateResult();
|
||||
|
||||
@@ -50,17 +50,17 @@ namespace OpenRCT2::GameActions
|
||||
if (_year < 0 || _year >= kMaxYear)
|
||||
{
|
||||
LOG_ERROR("Invalid park date year %d", _year);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(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 Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(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 Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
return Result();
|
||||
|
||||
@@ -46,17 +46,17 @@ namespace OpenRCT2::GameActions
|
||||
if ((getGameState().park.flags & PARK_FLAGS_NO_MONEY) != 0)
|
||||
{
|
||||
LOG_ERROR("Can't set park entrance fee because the park has no money");
|
||||
return Result(Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone);
|
||||
return Result(Status::disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone);
|
||||
}
|
||||
else if (!Park::EntranceFeeUnlocked())
|
||||
{
|
||||
LOG_ERROR("Park entrance fee is locked");
|
||||
return Result(Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone);
|
||||
return Result(Status::disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone);
|
||||
}
|
||||
else if (_fee < 0.00_GBP || _fee > kMaxEntranceFee)
|
||||
{
|
||||
LOG_ERROR("Invalid park entrance fee %d", _fee);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
return Result();
|
||||
|
||||
@@ -45,18 +45,18 @@ namespace OpenRCT2::GameActions
|
||||
auto& park = getGameState().park;
|
||||
if (_value > park.bankLoan && _value > park.maxBankLoan)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BORROW_ANY_MORE_MONEY, STR_BANK_REFUSES_TO_INCREASE_LOAN);
|
||||
return Result(Status::disallowed, STR_CANT_BORROW_ANY_MORE_MONEY, STR_BANK_REFUSES_TO_INCREASE_LOAN);
|
||||
}
|
||||
if (_value < park.bankLoan && _value < 0.00_GBP)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_PAY_BACK_LOAN, STR_LOAN_CANT_BE_NEGATIVE);
|
||||
return Result(Status::invalidParameters, STR_CANT_PAY_BACK_LOAN, STR_LOAN_CANT_BE_NEGATIVE);
|
||||
}
|
||||
// The “isPayingBack” check is needed to allow increasing the loan when the player is in debt.
|
||||
const auto isPayingBack = park.bankLoan > _value;
|
||||
const auto amountToPayBack = park.bankLoan - _value;
|
||||
if (isPayingBack && amountToPayBack > park.cash)
|
||||
{
|
||||
return Result(Status::InsufficientFunds, STR_CANT_PAY_BACK_LOAN, STR_NOT_ENOUGH_CASH_AVAILABLE);
|
||||
return Result(Status::insufficientFunds, STR_CANT_PAY_BACK_LOAN, STR_NOT_ENOUGH_CASH_AVAILABLE);
|
||||
}
|
||||
return Result();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRCT2::GameActions
|
||||
if (_name.empty())
|
||||
{
|
||||
LOG_ERROR("Can't set park name to empty string");
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_PARK, STR_INVALID_NAME_FOR_PARK);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_PARK, STR_INVALID_NAME_FOR_PARK);
|
||||
}
|
||||
return Result();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenRCT2::GameActions
|
||||
if (_parameter >= ParkParameter::Count)
|
||||
{
|
||||
LOG_ERROR("Invalid park parameter %d", _parameter);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -81,7 +81,7 @@ namespace OpenRCT2::GameActions
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("Invalid park parameter %d", _parameter);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRCT2::GameActions
|
||||
if (_fundingAmount >= RESEARCH_FUNDING_COUNT)
|
||||
{
|
||||
LOG_ERROR("Invalid research funding amount %d", _fundingAmount);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
return Result();
|
||||
}
|
||||
|
||||
@@ -51,19 +51,19 @@ namespace OpenRCT2::GameActions
|
||||
if (_entityId.ToUnderlying() >= kMaxEntities || _entityId.IsNull())
|
||||
{
|
||||
LOG_ERROR("Failed to pick up peep for sprite %d", _entityId);
|
||||
return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
if (!_loc.IsNull() && !LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
auto* const peep = getGameState().entities.TryGetEntity<Peep>(_entityId);
|
||||
if (peep == nullptr)
|
||||
{
|
||||
LOG_ERROR("Failed to pick up peep for sprite %d", _entityId);
|
||||
return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -75,7 +75,7 @@ namespace OpenRCT2::GameActions
|
||||
res.Position = peep->GetLocation();
|
||||
if (!peep->CanBePickedUp())
|
||||
{
|
||||
return Result(Status::Disallowed, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
return Result(Status::disallowed, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
}
|
||||
Peep* existing = Network::GetPickupPeep(_owner);
|
||||
if (existing != nullptr)
|
||||
@@ -100,17 +100,17 @@ namespace OpenRCT2::GameActions
|
||||
res.Position = _loc;
|
||||
if (Network::GetPickupPeep(_owner) != peep)
|
||||
{
|
||||
return Result(Status::Unknown, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
return Result(Status::unknown, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
if (auto res2 = peep->Place(TileCoordsXYZ(_loc), false); res2.Error != Status::Ok)
|
||||
if (auto res2 = peep->Place(TileCoordsXYZ(_loc), false); res2.Error != Status::ok)
|
||||
{
|
||||
return res2;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("Invalid peep pickup type %u", _type);
|
||||
return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ namespace OpenRCT2::GameActions
|
||||
if (peep == nullptr)
|
||||
{
|
||||
LOG_ERROR("Failed to pick up peep for sprite %d", _entityId);
|
||||
return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -171,7 +171,7 @@ namespace OpenRCT2::GameActions
|
||||
break;
|
||||
case PeepPickupType::Place:
|
||||
res.Position = _loc;
|
||||
if (auto res2 = peep->Place(TileCoordsXYZ(_loc), true); res2.Error != Status::Ok)
|
||||
if (auto res2 = peep->Place(TileCoordsXYZ(_loc), true); res2.Error != Status::ok)
|
||||
{
|
||||
return res2;
|
||||
}
|
||||
@@ -179,7 +179,7 @@ namespace OpenRCT2::GameActions
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("Invalid peep pickup type %u", _type);
|
||||
return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (!isInEditorMode() && !getGameState().cheats.sandboxMode)
|
||||
{
|
||||
return Result(Status::NotInEditorMode, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, kStringIdNone);
|
||||
return Result(Status::notInEditorMode, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -59,26 +59,26 @@ namespace OpenRCT2::GameActions
|
||||
if (!LocationValid(_location) || _location.x <= 16 || _location.y <= 16 || _location.x >= mapSizeUnits.x
|
||||
|| _location.y >= mapSizeUnits.y)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
// Verify footpath exists at location, and retrieve coordinates
|
||||
auto pathElement = MapGetPathElementAt(TileCoordsXYZ{ _location });
|
||||
if (pathElement == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_CAN_ONLY_BE_BUILT_ON_PATHS);
|
||||
return Result(Status::invalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_CAN_ONLY_BE_BUILT_ON_PATHS);
|
||||
}
|
||||
|
||||
// Verify location is unowned
|
||||
auto surfaceMapElement = MapGetSurfaceElementAt(_location);
|
||||
if (surfaceMapElement == nullptr)
|
||||
{
|
||||
return Result(Status::Unknown, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::unknown, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
if (surfaceMapElement->GetOwnership() != OWNERSHIP_UNOWNED)
|
||||
{
|
||||
return Result(
|
||||
Status::InvalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_ERR_MUST_BE_OUTSIDE_PARK_BOUNDARIES);
|
||||
Status::invalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_ERR_MUST_BE_OUTSIDE_PARK_BOUNDARIES);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
@@ -79,40 +79,40 @@ namespace OpenRCT2::GameActions
|
||||
if (rideIndex.IsNull())
|
||||
{
|
||||
// No more free slots available.
|
||||
return Result(Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_TOO_MANY_RIDES);
|
||||
return Result(Status::noFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_TOO_MANY_RIDES);
|
||||
}
|
||||
|
||||
if (_rideType >= RIDE_TYPE_COUNT)
|
||||
{
|
||||
LOG_ERROR("Invalid ride type %d", _rideType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE);
|
||||
}
|
||||
|
||||
int32_t rideEntryIndex = RideGetEntryIndex(_rideType, _subType);
|
||||
if (rideEntryIndex >= kMaxRideObjects)
|
||||
{
|
||||
LOG_ERROR("Ride entry not found for rideType %d, subType %d", _rideType, _subType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE);
|
||||
}
|
||||
|
||||
const auto& colourPresets = GetRideTypeDescriptor(_rideType).ColourPresets;
|
||||
if (_trackColourPreset >= colourPresets.count)
|
||||
{
|
||||
LOG_ERROR("Can't create ride, invalid colour preset %d", _trackColourPreset);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_ERR_INVALID_COLOUR);
|
||||
return Result(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 Result(Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
const auto* presetList = rideEntry->vehicle_preset_list;
|
||||
if ((presetList->count > 0 && presetList->count != 255) && _vehicleColourPreset >= presetList->count)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -135,7 +135,7 @@ namespace OpenRCT2::GameActions
|
||||
LOG_ERROR(
|
||||
"Ride entry not found for index rideEntryIndex %u (from rideType %u, subType %u)", rideEntryIndex, _rideType,
|
||||
_subType);
|
||||
return Result(Status::Unknown, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::unknown, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
ride->type = _rideType;
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if ((ride->lifecycleFlags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK)
|
||||
@@ -69,7 +69,7 @@ namespace OpenRCT2::GameActions
|
||||
&& !getGameState().cheats.makeAllDestructible)
|
||||
{
|
||||
return Result(
|
||||
Status::NoClearance, STR_CANT_DEMOLISH_RIDE,
|
||||
Status::noClearance, STR_CANT_DEMOLISH_RIDE,
|
||||
STR_LOCAL_AUTHORITY_FORBIDS_DEMOLITION_OR_MODIFICATIONS_TO_THIS_RIDE);
|
||||
}
|
||||
|
||||
@@ -79,18 +79,18 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (ride->status != RideStatus::closed && ride->status != RideStatus::simulating)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_REFURBISH_RIDE, STR_MUST_BE_CLOSED_FIRST);
|
||||
return Result(Status::disallowed, STR_CANT_REFURBISH_RIDE, STR_MUST_BE_CLOSED_FIRST);
|
||||
}
|
||||
|
||||
if (ride->numRiders > 0)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_REFURBISH_RIDE, STR_RIDE_NOT_YET_EMPTY);
|
||||
return Result(Status::disallowed, STR_CANT_REFURBISH_RIDE, STR_RIDE_NOT_YET_EMPTY);
|
||||
}
|
||||
|
||||
if (!(ride->lifecycleFlags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)
|
||||
|| ride->getRideTypeDescriptor().AvailableBreakdowns == 0)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_REFURBISH_RIDE, STR_CANT_REFURBISH_NOT_NEEDED);
|
||||
return Result(Status::disallowed, STR_CANT_REFURBISH_RIDE, STR_CANT_REFURBISH_NOT_NEEDED);
|
||||
}
|
||||
|
||||
result.ErrorTitle = STR_CANT_REFURBISH_RIDE;
|
||||
@@ -106,7 +106,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
switch (_modifyType)
|
||||
@@ -117,7 +117,7 @@ namespace OpenRCT2::GameActions
|
||||
return RefurbishRide(gameState, *ride);
|
||||
default:
|
||||
LOG_ERROR("Unknown ride demolish type %d", _modifyType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_DO_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_DO_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace OpenRCT2::GameActions
|
||||
setMazeTrack.SetFlags(GetFlags());
|
||||
|
||||
auto execRes = ExecuteNested(&setMazeTrack, gameState);
|
||||
if (execRes.Error == Status::Ok)
|
||||
if (execRes.Error == Status::ok)
|
||||
{
|
||||
return execRes.Cost;
|
||||
}
|
||||
@@ -230,7 +230,7 @@ namespace OpenRCT2::GameActions
|
||||
trackRemoveAction.SetFlags({ CommandFlag::noSpend });
|
||||
|
||||
auto removRes = ExecuteNested(&trackRemoveAction, gameState);
|
||||
if (removRes.Error != Status::Ok)
|
||||
if (removRes.Error != Status::ok)
|
||||
{
|
||||
TileElementRemove(tileElement);
|
||||
}
|
||||
|
||||
@@ -64,23 +64,23 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (_stationNum.ToUnderlying() >= Limits::kMaxStationsPerRide)
|
||||
{
|
||||
LOG_ERROR("Invalid station number for ride. stationNum: %u", _stationNum.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, errorTitle, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, errorTitle, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
if (ride->status != RideStatus::closed && ride->status != RideStatus::simulating)
|
||||
{
|
||||
return Result(Status::NotClosed, errorTitle, STR_MUST_BE_CLOSED_FIRST);
|
||||
return Result(Status::notClosed, errorTitle, STR_MUST_BE_CLOSED_FIRST);
|
||||
}
|
||||
|
||||
if (ride->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK)
|
||||
{
|
||||
return Result(Status::Disallowed, errorTitle, STR_NOT_ALLOWED_TO_MODIFY_STATION);
|
||||
return Result(Status::disallowed, errorTitle, STR_NOT_ALLOWED_TO_MODIFY_STATION);
|
||||
}
|
||||
|
||||
const auto& station = ride->getStation(_stationNum);
|
||||
@@ -93,7 +93,7 @@ namespace OpenRCT2::GameActions
|
||||
rideEntranceExitRemove.SetFlags(GetFlags());
|
||||
|
||||
auto result = QueryNested(&rideEntranceExitRemove, gameState);
|
||||
if (result.Error != Status::Ok)
|
||||
if (result.Error != Status::ok)
|
||||
{
|
||||
result.ErrorTitle = errorTitle;
|
||||
return result;
|
||||
@@ -103,21 +103,21 @@ namespace OpenRCT2::GameActions
|
||||
auto z = ride->getStation(_stationNum).GetBaseZ();
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, errorTitle, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, errorTitle, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
if (!getGameState().cheats.sandboxMode && !MapIsLocationOwned({ _loc, z }))
|
||||
{
|
||||
return Result(Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
if (!MapCheckCapacityAndReorganise(_loc))
|
||||
{
|
||||
return Result(Status::NoFreeElements, errorTitle, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
return Result(Status::noFreeElements, errorTitle, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
auto clear_z = z + (_isExit ? RideExitHeight : RideEntranceHeight);
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ _loc, z, clear_z }, MapPlaceNonSceneryClearFunc, { 0b1111, 0 }, GetFlags(), kTileSlopeFlat);
|
||||
if (canBuild.Error != Status::Ok)
|
||||
if (canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = errorTitle;
|
||||
return canBuild;
|
||||
@@ -126,12 +126,12 @@ namespace OpenRCT2::GameActions
|
||||
const auto clearanceData = canBuild.GetData<ConstructClearResult>();
|
||||
if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)
|
||||
{
|
||||
return Result(Status::Disallowed, errorTitle, STR_RIDE_CANT_BUILD_THIS_UNDERWATER);
|
||||
return Result(Status::disallowed, errorTitle, STR_RIDE_CANT_BUILD_THIS_UNDERWATER);
|
||||
}
|
||||
|
||||
if (z > MaxRideEntranceOrExitHeight)
|
||||
{
|
||||
return Result(Status::Disallowed, errorTitle, STR_TOO_HIGH);
|
||||
return Result(Status::disallowed, errorTitle, STR_TOO_HIGH);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -151,7 +151,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
@@ -169,7 +169,7 @@ namespace OpenRCT2::GameActions
|
||||
rideEntranceExitRemove.SetFlags(GetFlags());
|
||||
|
||||
auto result = ExecuteNested(&rideEntranceExitRemove, gameState);
|
||||
if (result.Error != Status::Ok)
|
||||
if (result.Error != Status::ok)
|
||||
{
|
||||
result.ErrorTitle = errorTitle;
|
||||
return result;
|
||||
@@ -188,7 +188,7 @@ namespace OpenRCT2::GameActions
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ _loc, z, clear_z }, MapPlaceNonSceneryClearFunc, { 0b1111, 0 }, GetFlags().with(CommandFlag::apply),
|
||||
kTileSlopeFlat);
|
||||
if (canBuild.Error != Status::Ok)
|
||||
if (canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = errorTitle;
|
||||
return canBuild;
|
||||
@@ -244,18 +244,18 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!getGameState().cheats.sandboxMode && !MapIsLocationOwned(loc))
|
||||
{
|
||||
return Result(Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
if (!MapCheckCapacityAndReorganise(loc))
|
||||
{
|
||||
return Result(Status::NoFreeElements, errorTitle, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
return Result(Status::noFreeElements, errorTitle, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
int16_t baseZ = loc.z;
|
||||
int16_t clearZ = baseZ + (isExit ? RideExitHeight : RideEntranceHeight);
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ loc, baseZ, clearZ }, MapPlaceNonSceneryClearFunc, { 0b1111, 0 }, {}, kTileSlopeFlat);
|
||||
if (canBuild.Error != Status::Ok)
|
||||
if (canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = errorTitle;
|
||||
return canBuild;
|
||||
@@ -264,12 +264,12 @@ namespace OpenRCT2::GameActions
|
||||
const auto clearanceData = canBuild.GetData<ConstructClearResult>();
|
||||
if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)
|
||||
{
|
||||
return Result(Status::Disallowed, errorTitle, STR_RIDE_CANT_BUILD_THIS_UNDERWATER);
|
||||
return Result(Status::disallowed, errorTitle, STR_RIDE_CANT_BUILD_THIS_UNDERWATER);
|
||||
}
|
||||
|
||||
if (baseZ > MaxRideEntranceOrExitHeight)
|
||||
{
|
||||
return Result(Status::Disallowed, errorTitle, STR_TOO_HIGH);
|
||||
return Result(Status::disallowed, errorTitle, STR_TOO_HIGH);
|
||||
}
|
||||
auto res = Result();
|
||||
res.Position = { loc.ToTileCentre(), TileElementHeight(loc) };
|
||||
|
||||
@@ -73,22 +73,22 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (ride->status != RideStatus::closed && ride->status != RideStatus::simulating)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_MUST_BE_CLOSED_FIRST, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_MUST_BE_CLOSED_FIRST, kStringIdNone);
|
||||
}
|
||||
|
||||
if (ride->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_NOT_ALLOWED_TO_MODIFY_STATION, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_NOT_ALLOWED_TO_MODIFY_STATION, kStringIdNone);
|
||||
}
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
auto* entranceElement = FindEntranceElement(
|
||||
@@ -97,14 +97,14 @@ namespace OpenRCT2::GameActions
|
||||
// If we are trying to remove a ghost and the element we found is real, return an error, but don't log a warning
|
||||
if (entranceElement != nullptr && (GetFlags().has(CommandFlag::ghost)) && !(entranceElement->IsGhost()))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_GHOST_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_GHOST_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
else if (entranceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR(
|
||||
"Entrance/exit element not found. x = %d, y = %d, ride = %u, station = %u", _loc.x, _loc.y,
|
||||
_rideIndex.ToUnderlying(), _stationNum.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -116,7 +116,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
const bool isGhost = GetFlags().has(CommandFlag::ghost);
|
||||
@@ -133,14 +133,14 @@ namespace OpenRCT2::GameActions
|
||||
// If we are trying to remove a ghost and the element we found is real, return an error, but don't log a warning
|
||||
if (entranceElement != nullptr && isGhost && !(entranceElement->IsGhost()))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_GHOST_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_GHOST_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
else if (entranceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR(
|
||||
"Entrance/exit element not found. x = %d, y = %d, ride = %u, station = %d", _loc.x, _loc.y,
|
||||
_rideIndex.ToUnderlying(), _stationNum);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
|
||||
@@ -40,13 +40,13 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (_value <= 0)
|
||||
{
|
||||
LOG_ERROR("Rating value must be positive: %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
return Result();
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
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);
|
||||
GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
switch (_type)
|
||||
@@ -69,7 +69,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
LOG_ERROR("Invalid track colour %u", _index);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR);
|
||||
GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
break;
|
||||
case RideSetAppearanceType::VehicleColourBody:
|
||||
@@ -79,7 +79,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
LOG_ERROR("Invalid vehicle colour %u", _index);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR);
|
||||
GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
break;
|
||||
case RideSetAppearanceType::VehicleColourScheme:
|
||||
@@ -89,7 +89,7 @@ namespace OpenRCT2::GameActions
|
||||
default:
|
||||
LOG_ERROR("Invalid ride appearance type %u", _type);
|
||||
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_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
return GameActions::Result();
|
||||
@@ -102,7 +102,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
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);
|
||||
GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
switch (_type)
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
// Find the relevant track piece, prefer sequence 0 (logic copied from GetTrackElementOriginAndApplyChanges)
|
||||
auto trackElement = MapGetTrackElementAtOfTypeSeq(_loc, _trackType, 0);
|
||||
@@ -60,12 +60,12 @@ namespace OpenRCT2::GameActions
|
||||
trackElement = MapGetTrackElementAtOfType(_loc, _trackType);
|
||||
if (trackElement == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_TRACK_PARAMETERS);
|
||||
return Result(Status::invalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_TRACK_PARAMETERS);
|
||||
}
|
||||
}
|
||||
if (_newColourScheme >= kNumRideColourSchemes)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_COLOUR_SCHEME_PARAMETER);
|
||||
return Result(Status::invalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_COLOUR_SCHEME_PARAMETER);
|
||||
}
|
||||
return Result();
|
||||
}
|
||||
|
||||
@@ -52,12 +52,12 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (!_name.empty() && Ride::nameExists(_name, ride->id))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERROR_EXISTING_NAME);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERROR_EXISTING_NAME);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -69,7 +69,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (_name.empty())
|
||||
|
||||
@@ -56,20 +56,20 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
const auto* rideEntry = GetRideEntryByIndex(ride->subtype);
|
||||
if (rideEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride entry not found for ride subtype %u", ride->subtype);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (_price < kRideMinPrice || _price > kRideMaxPrice)
|
||||
{
|
||||
LOG_ERROR("Attempting to set an invalid price for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -84,20 +84,20 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
const auto* rideEntry = GetRideEntryByIndex(ride->subtype);
|
||||
if (rideEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride entry not found for ride subtype %u", ride->subtype);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (_price < kRideMinPrice || _price > kRideMaxPrice)
|
||||
{
|
||||
LOG_ERROR("Attempting to set an invalid price for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty);
|
||||
}
|
||||
|
||||
if (!ride->overallView.IsNull())
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u.", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
switch (_setting)
|
||||
@@ -60,18 +60,18 @@ namespace OpenRCT2::GameActions
|
||||
case RideSetSetting::Mode:
|
||||
if (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING);
|
||||
return Result(Status::disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING);
|
||||
}
|
||||
|
||||
if (ride->status != RideStatus::closed && ride->status != RideStatus::simulating)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_MUST_BE_CLOSED_FIRST);
|
||||
return Result(Status::disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_MUST_BE_CLOSED_FIRST);
|
||||
}
|
||||
|
||||
if (!RideIsModeValid(*ride) && !getGameState().cheats.showAllOperatingModes)
|
||||
{
|
||||
LOG_ERROR("Invalid ride mode: %u", _value);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
break;
|
||||
case RideSetSetting::Departure:
|
||||
@@ -80,28 +80,28 @@ namespace OpenRCT2::GameActions
|
||||
if (_value > 250)
|
||||
{
|
||||
LOG_ERROR("Invalid minimum waiting time: %u", _value);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
break;
|
||||
case RideSetSetting::MaxWaitingTime:
|
||||
if (_value > 250)
|
||||
{
|
||||
LOG_ERROR("Invalid maximum waiting time: %u", _value);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
break;
|
||||
case RideSetSetting::Operation:
|
||||
if (!RideIsValidOperationOption(*ride))
|
||||
{
|
||||
LOG_ERROR("Invalid operation option value: %u", _value);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, GetOperationErrorMessage(*ride));
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, GetOperationErrorMessage(*ride));
|
||||
}
|
||||
break;
|
||||
case RideSetSetting::InspectionInterval:
|
||||
if (_value > RIDE_INSPECTION_NEVER)
|
||||
{
|
||||
LOG_ERROR("Invalid inspection interval: %u", _value);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
break;
|
||||
case RideSetSetting::Music:
|
||||
@@ -113,7 +113,7 @@ namespace OpenRCT2::GameActions
|
||||
if (musicObj == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid music style: %u", _value);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -121,33 +121,33 @@ namespace OpenRCT2::GameActions
|
||||
if (!RideIsValidLiftHillSpeed(*ride))
|
||||
{
|
||||
LOG_ERROR("Invalid lift hill speed: %u", _value);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
break;
|
||||
case RideSetSetting::NumCircuits:
|
||||
if (ride->lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT && _value > 1)
|
||||
{
|
||||
return Result(
|
||||
Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE,
|
||||
Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE,
|
||||
STR_MULTICIRCUIT_NOT_POSSIBLE_WITH_CABLE_LIFT_HILL);
|
||||
}
|
||||
|
||||
if (!RideIsValidNumCircuits())
|
||||
{
|
||||
LOG_ERROR("Invalid number of circuits: %u", _value);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
break;
|
||||
case RideSetSetting::RideType:
|
||||
if (!getGameState().cheats.allowArbitraryRideTypeChanges)
|
||||
{
|
||||
LOG_ERROR("Arbitrary ride type changes not allowed.");
|
||||
return Result(Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, kStringIdNone);
|
||||
return Result(Status::disallowed, STR_CANT_CHANGE_OPERATING_MODE, kStringIdNone);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("Invalid ride setting %u", static_cast<uint8_t>(_setting));
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -159,7 +159,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
switch (_setting)
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
res.Error = Status::InvalidParameters;
|
||||
res.Error = Status::invalidParameters;
|
||||
res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
|
||||
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
|
||||
return res;
|
||||
@@ -70,7 +70,7 @@ namespace OpenRCT2::GameActions
|
||||
if (_status >= RideStatus::count)
|
||||
{
|
||||
LOG_ERROR("Invalid ride status %u for ride %u", EnumValue(_status), _rideIndex.ToUnderlying());
|
||||
res.Error = Status::InvalidParameters;
|
||||
res.Error = Status::invalidParameters;
|
||||
res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
|
||||
res.ErrorMessage = kStringIdNone;
|
||||
return res;
|
||||
@@ -85,7 +85,7 @@ namespace OpenRCT2::GameActions
|
||||
if (_status == RideStatus::simulating && (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN))
|
||||
{
|
||||
// Simulating will force clear the track, so make sure player can't cheat around a break down
|
||||
res.Error = Status::Disallowed;
|
||||
res.Error = Status::disallowed;
|
||||
res.ErrorMessage = STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING;
|
||||
return res;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!modeSwitchResult.Successful)
|
||||
{
|
||||
res.Error = Status::Unknown;
|
||||
res.Error = Status::unknown;
|
||||
res.ErrorMessage = modeSwitchResult.Message;
|
||||
return res;
|
||||
}
|
||||
@@ -125,7 +125,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
res.Error = Status::InvalidParameters;
|
||||
res.Error = Status::invalidParameters;
|
||||
res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
|
||||
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
|
||||
return res;
|
||||
@@ -172,7 +172,7 @@ namespace OpenRCT2::GameActions
|
||||
const auto modeSwitchResult = ride->simulate(true);
|
||||
if (!modeSwitchResult.Successful)
|
||||
{
|
||||
res.Error = Status::Unknown;
|
||||
res.Error = Status::unknown;
|
||||
res.ErrorMessage = modeSwitchResult.Message;
|
||||
return res;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ namespace OpenRCT2::GameActions
|
||||
const auto modeSwitchResult = ride->test(true);
|
||||
if (!modeSwitchResult.Successful)
|
||||
{
|
||||
res.Error = Status::Unknown;
|
||||
res.Error = Status::unknown;
|
||||
res.ErrorMessage = modeSwitchResult.Message;
|
||||
return res;
|
||||
}
|
||||
@@ -225,7 +225,7 @@ namespace OpenRCT2::GameActions
|
||||
const auto modeSwitchResult = ride->open(true);
|
||||
if (!modeSwitchResult.Successful)
|
||||
{
|
||||
res.Error = Status::Unknown;
|
||||
res.Error = Status::unknown;
|
||||
res.ErrorMessage = modeSwitchResult.Message;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -73,17 +73,17 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (ride->lifecycleFlags & RIDE_LIFECYCLE_BROKEN_DOWN)
|
||||
{
|
||||
return Result(Status::Broken, errTitle, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING);
|
||||
return Result(Status::broken, errTitle, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING);
|
||||
}
|
||||
|
||||
if (ride->status != RideStatus::closed && ride->status != RideStatus::simulating)
|
||||
{
|
||||
return Result(Status::NotClosed, errTitle, STR_MUST_BE_CLOSED_FIRST);
|
||||
return Result(Status::notClosed, errTitle, STR_MUST_BE_CLOSED_FIRST);
|
||||
}
|
||||
|
||||
switch (_type)
|
||||
@@ -97,13 +97,13 @@ namespace OpenRCT2::GameActions
|
||||
if (!RideIsVehicleTypeValid(*ride))
|
||||
{
|
||||
LOG_ERROR("Invalid vehicle type %d", _value);
|
||||
return Result(Status::InvalidParameters, errTitle, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, errTitle, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
auto rideEntry = GetRideEntryByIndex(_value);
|
||||
if (rideEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride entry not found for _value %d", _value);
|
||||
return Result(Status::InvalidParameters, errTitle, kStringIdNone);
|
||||
return Result(Status::invalidParameters, errTitle, kStringIdNone);
|
||||
}
|
||||
|
||||
// Validate preset
|
||||
@@ -111,14 +111,14 @@ namespace OpenRCT2::GameActions
|
||||
if (_colour >= presetList->count && _colour != 255 && _colour != 0)
|
||||
{
|
||||
LOG_ERROR("Unknown vehicle colour preset. colour = %d", _colour);
|
||||
return Result(Status::InvalidParameters, errTitle, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, errTitle, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
LOG_ERROR("Invalid ride vehicle setting %d", _type);
|
||||
return Result(Status::InvalidParameters, errTitle, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, errTitle, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -131,7 +131,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
switch (_type)
|
||||
@@ -154,7 +154,7 @@ namespace OpenRCT2::GameActions
|
||||
if (rideEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride entry not found for index %d", ride->subtype);
|
||||
return Result(Status::InvalidParameters, errTitle, kStringIdNone);
|
||||
return Result(Status::invalidParameters, errTitle, kStringIdNone);
|
||||
}
|
||||
uint8_t clampValue = _value;
|
||||
static_assert(sizeof(clampValue) == sizeof(ride->proposedNumCarsPerTrain));
|
||||
@@ -177,7 +177,7 @@ namespace OpenRCT2::GameActions
|
||||
if (rideEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride entry not found for index %d", ride->subtype);
|
||||
return Result(Status::InvalidParameters, errTitle, kStringIdNone);
|
||||
return Result(Status::invalidParameters, errTitle, kStringIdNone);
|
||||
}
|
||||
|
||||
RideSetVehicleColoursToRandomPreset(*ride, _colour);
|
||||
@@ -200,7 +200,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
default:
|
||||
LOG_ERROR("Invalid ride vehicle setting %d", _type);
|
||||
return Result(Status::InvalidParameters, errTitle, kStringIdNone);
|
||||
return Result(Status::invalidParameters, errTitle, kStringIdNone);
|
||||
}
|
||||
|
||||
ride->numCircuits = 1;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenRCT2::GameActions
|
||||
if (_setting >= ScenarioSetSetting::Count)
|
||||
{
|
||||
LOG_ERROR("Invalid scenario setting: %u", _setting);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -263,7 +263,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
default:
|
||||
LOG_ERROR("Invalid scenario setting %u", _setting);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
windowMgr->InvalidateByClass(WindowClass::editorScenarioOptions);
|
||||
return Result();
|
||||
|
||||
@@ -38,12 +38,12 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (!ObjectTypeCanBeRestricted(_objectType))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_RESTRICT_OBJECT, STR_OBJECT_TYPE_CANNOT_BE_RESTRICTED);
|
||||
return Result(Status::invalidParameters, STR_CANT_RESTRICT_OBJECT, STR_OBJECT_TYPE_CANNOT_BE_RESTRICTED);
|
||||
}
|
||||
const auto* loadedObject = ObjectEntryGetObject(_objectType, _objectIndex);
|
||||
if (loadedObject == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_RESTRICT_OBJECT, STR_OBJECT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_RESTRICT_OBJECT, STR_OBJECT_NOT_FOUND);
|
||||
}
|
||||
|
||||
return Result();
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenRCT2::GameActions
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone);
|
||||
}
|
||||
|
||||
TileElement* tileElement = BannerGetTileElement(_bannerIndex);
|
||||
@@ -58,18 +58,18 @@ namespace OpenRCT2::GameActions
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner tile element not found for bannerIndex %d", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
CoordsXYZ loc = { banner->position.ToCoordsXY(), tileElement->GetBaseZ() };
|
||||
|
||||
if (!LocationValid(loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
if (!MapCanBuildAt({ loc.x, loc.y, loc.z - 16 }))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -81,7 +81,7 @@ namespace OpenRCT2::GameActions
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone);
|
||||
}
|
||||
|
||||
if (!_name.empty())
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace OpenRCT2::GameActions
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner not found for bannerIndex %u", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
CoordsXYZ loc;
|
||||
@@ -67,14 +67,14 @@ namespace OpenRCT2::GameActions
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Banner tile element not found for bannerIndex %u", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
if (tileElement->GetType() != TileElementType::LargeScenery)
|
||||
{
|
||||
LOG_ERROR(
|
||||
"Tile element has type %u, expected %d (LargeScenery)", tileElement->GetType(),
|
||||
TileElementType::LargeScenery);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
loc = { banner->position.ToCoordsXY(), tileElement->GetBaseZ() };
|
||||
}
|
||||
@@ -85,18 +85,18 @@ namespace OpenRCT2::GameActions
|
||||
if (wallElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Wall element not found for bannerIndex", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
loc = { banner->position.ToCoordsXY(), wallElement->GetBaseZ() };
|
||||
}
|
||||
|
||||
if (!LocationValid(loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_RENAME_BANNER, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
if (!MapCanBuildAt({ loc.x, loc.y, loc.z - 16 }))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_RENAME_BANNER, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -108,7 +108,7 @@ namespace OpenRCT2::GameActions
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid banner id %u", _bannerIndex);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
CoordsXY coords = banner->position.ToCoordsXY();
|
||||
@@ -120,7 +120,7 @@ namespace OpenRCT2::GameActions
|
||||
{ coords, tileElement->GetBaseZ(), tileElement->GetDirection() },
|
||||
tileElement->AsLargeScenery()->GetSequenceIndex(), _mainColour, _textColour))
|
||||
{
|
||||
return Result(Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::unknown, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -108,25 +108,25 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (!MapCheckCapacityAndReorganise(_loc))
|
||||
{
|
||||
return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
||||
auto maxSizeMax = GetMapSizeMaxXY();
|
||||
if (!_trackDesignDrawingPreview && (_loc.x > maxSizeMax.x || _loc.y > maxSizeMax.y))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(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 Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
auto quadrant = _quadrant;
|
||||
@@ -173,7 +173,7 @@ namespace OpenRCT2::GameActions
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode
|
||||
&& !MapIsLocationOwned({ _loc.x, _loc.y, targetHeight }))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
auto* surfaceElement = MapGetSurfaceElementAt(_loc);
|
||||
@@ -183,7 +183,7 @@ namespace OpenRCT2::GameActions
|
||||
int32_t water_height = surfaceElement->GetWaterHeight() - 1;
|
||||
if (water_height > targetHeight)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
|
||||
return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,14 +191,14 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (isOnWater)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND);
|
||||
return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND);
|
||||
}
|
||||
|
||||
if (surfaceElement != nullptr && surfaceElement->GetWaterHeight() > 0)
|
||||
{
|
||||
if (surfaceElement->GetWaterHeight() > targetHeight)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND);
|
||||
return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ namespace OpenRCT2::GameActions
|
||||
if (!gameState.cheats.disableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_REQUIRE_FLAT_SURFACE))
|
||||
&& !supportsRequired && !isOnWater && surfaceElement != nullptr && (surfaceElement->GetSlope() != kTileSlopeFlat))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED);
|
||||
return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED);
|
||||
}
|
||||
|
||||
if (!gameState.cheats.disableSupportLimits && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE))
|
||||
@@ -218,13 +218,13 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (surfaceElement->GetWaterHeight() > 0 || (surfaceElement->GetBaseZ()) != targetHeight)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED);
|
||||
return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND);
|
||||
return Result(Status::disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace OpenRCT2::GameActions
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ _loc, zLow, zHigh }, MapPlaceSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat, CreateCrossingMode::none,
|
||||
isTree);
|
||||
if (canBuild.Error != Status::Ok)
|
||||
if (canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = STR_CANT_POSITION_THIS_HERE;
|
||||
return canBuild;
|
||||
@@ -316,7 +316,7 @@ namespace OpenRCT2::GameActions
|
||||
if (sceneryEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Small scenery object entry not found for sceneryType %u", _sceneryType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
auto quadrant = _quadrant;
|
||||
@@ -408,7 +408,7 @@ namespace OpenRCT2::GameActions
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ _loc, zLow, zHigh }, MapPlaceSceneryClearFunc, quarterTile, GetFlags().with(CommandFlag::apply), kTileSlopeFlat,
|
||||
CreateCrossingMode::none, isTree);
|
||||
if (canBuild.Error != Status::Ok)
|
||||
if (canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = STR_CANT_POSITION_THIS_HERE;
|
||||
return canBuild;
|
||||
@@ -421,7 +421,7 @@ namespace OpenRCT2::GameActions
|
||||
CoordsXYZ{ _loc, zLow }, quarterTile.GetBaseQuarterOccupied());
|
||||
if (sceneryElement == nullptr)
|
||||
{
|
||||
return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
||||
sceneryElement->SetDirection(_loc.direction);
|
||||
|
||||
@@ -61,13 +61,13 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
auto* entry = OpenRCT2::ObjectManager::GetObjectEntry<SmallSceneryEntry>(_sceneryType);
|
||||
if (entry == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
}
|
||||
|
||||
res.Cost = entry->removal_price;
|
||||
@@ -82,7 +82,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (entry->HasFlag(SMALL_SCENERY_FLAG_IS_TREE))
|
||||
{
|
||||
res.Error = Status::NoClearance;
|
||||
res.Error = Status::noClearance;
|
||||
res.ErrorTitle = STR_CANT_REMOVE_THIS;
|
||||
res.ErrorMessage = STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY;
|
||||
return res;
|
||||
@@ -92,7 +92,7 @@ namespace OpenRCT2::GameActions
|
||||
// Check if the land is owned
|
||||
if (!MapIsLocationOwned(_loc))
|
||||
{
|
||||
res.Error = Status::NoClearance;
|
||||
res.Error = Status::noClearance;
|
||||
res.ErrorTitle = STR_CANT_REMOVE_THIS;
|
||||
res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK;
|
||||
return res;
|
||||
@@ -102,7 +102,7 @@ namespace OpenRCT2::GameActions
|
||||
TileElement* tileElement = FindSceneryElement();
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -116,7 +116,7 @@ namespace OpenRCT2::GameActions
|
||||
if (entry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid small scenery type %u", _sceneryType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
}
|
||||
|
||||
res.Cost = entry->removal_price;
|
||||
@@ -126,7 +126,7 @@ namespace OpenRCT2::GameActions
|
||||
TileElement* tileElement = FindSceneryElement();
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
}
|
||||
|
||||
MapInvalidateTileFull(_loc);
|
||||
|
||||
@@ -80,14 +80,14 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode)
|
||||
{
|
||||
if (!MapIsLocationOwned(_loc))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace OpenRCT2::GameActions
|
||||
if (sceneryElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Small scenery not found at: x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
if ((GetFlags().has(CommandFlag::ghost)) && !(sceneryElement->IsGhost()))
|
||||
|
||||
@@ -43,23 +43,23 @@ namespace OpenRCT2::GameActions
|
||||
if (_spriteId.ToUnderlying() >= kMaxEntities || _spriteId.IsNull())
|
||||
{
|
||||
LOG_ERROR("Invalid spriteId %u", _spriteId);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
auto staff = getGameState().entities.TryGetEntity<Staff>(_spriteId);
|
||||
if (staff == nullptr)
|
||||
{
|
||||
LOG_ERROR("Staff entity not found for spriteId %u", _spriteId);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (staff->State == PeepState::fixing)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_FIRE_STAFF_FIXING, kStringIdNone);
|
||||
return Result(Status::disallowed, STR_CANT_FIRE_STAFF_FIXING, kStringIdNone);
|
||||
}
|
||||
else if (staff->State == PeepState::inspecting)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_FIRE_STAFF_INSPECTING, kStringIdNone);
|
||||
return Result(Status::disallowed, STR_CANT_FIRE_STAFF_INSPECTING, kStringIdNone);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -71,7 +71,7 @@ namespace OpenRCT2::GameActions
|
||||
if (staff == nullptr)
|
||||
{
|
||||
LOG_ERROR("Staff entity not found for spriteId %u", _spriteId);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto* windowMgr = Ui::GetWindowManager();
|
||||
|
||||
@@ -80,12 +80,12 @@ namespace OpenRCT2::GameActions
|
||||
if (_staffType >= static_cast<uint8_t>(StaffType::count))
|
||||
{
|
||||
LOG_ERROR("Invalid staff type %u", static_cast<uint32_t>(_staffType));
|
||||
return Result(Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
if (getGameState().entities.GetNumFreeEntities() < 400)
|
||||
{
|
||||
return Result(Status::NoFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME);
|
||||
return Result(Status::noFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME);
|
||||
}
|
||||
|
||||
if (_staffType == static_cast<uint8_t>(StaffType::entertainer))
|
||||
@@ -94,7 +94,7 @@ namespace OpenRCT2::GameActions
|
||||
if (std::find(costumes.begin(), costumes.end(), _costumeIndex) == costumes.end())
|
||||
{
|
||||
LOG_ERROR("Unavailable entertainer costume %u", static_cast<uint32_t>(_costumeIndex));
|
||||
return Result(Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace OpenRCT2::GameActions
|
||||
if (newPeep == nullptr)
|
||||
{
|
||||
// Too many peeps exist already.
|
||||
return Result(Status::NoFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME);
|
||||
return Result(Status::noFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME);
|
||||
}
|
||||
|
||||
if (execute == false)
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenRCT2::GameActions
|
||||
if (staffType != StaffType::handyman && staffType != StaffType::mechanic && staffType != StaffType::security)
|
||||
{
|
||||
LOG_ERROR("Staff color can't be changed for staff type %d", _staffType);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE);
|
||||
}
|
||||
return Result();
|
||||
}
|
||||
@@ -59,7 +59,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
// Update global uniform colour property
|
||||
auto res = StaffSetColour(static_cast<StaffType>(_staffType), _colour);
|
||||
if (res.Error != Status::Ok)
|
||||
if (res.Error != Status::ok)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -50,14 +50,14 @@ namespace OpenRCT2::GameActions
|
||||
if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull())
|
||||
{
|
||||
LOG_ERROR("Invalid sprite index %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
auto* staff = getGameState().entities.TryGetEntity<Staff>(_spriteIndex);
|
||||
if (staff == nullptr)
|
||||
{
|
||||
LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto& objManager = GetContext()->GetObjectManager();
|
||||
@@ -67,7 +67,7 @@ namespace OpenRCT2::GameActions
|
||||
if (animObj->GetPeepType() != animPeepType)
|
||||
{
|
||||
LOG_ERROR("Invalid entertainer costume %u", _costume);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
return Result();
|
||||
}
|
||||
@@ -78,7 +78,7 @@ namespace OpenRCT2::GameActions
|
||||
if (staff == nullptr)
|
||||
{
|
||||
LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
}
|
||||
|
||||
staff->AnimationObjectIndex = _costume;
|
||||
|
||||
@@ -52,14 +52,14 @@ namespace OpenRCT2::GameActions
|
||||
if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull())
|
||||
{
|
||||
LOG_ERROR("Invalid sprite index %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
auto staff = getGameState().entities.TryGetEntity<Staff>(_spriteIndex);
|
||||
if (staff == nullptr)
|
||||
{
|
||||
LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -71,7 +71,7 @@ namespace OpenRCT2::GameActions
|
||||
if (staff == nullptr)
|
||||
{
|
||||
LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto curName = staff->GetName();
|
||||
@@ -82,7 +82,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!staff->SetName(_name))
|
||||
{
|
||||
return Result(Status::Unknown, STR_CANT_NAME_GUEST, kStringIdNone);
|
||||
return Result(Status::unknown, STR_CANT_NAME_GUEST, kStringIdNone);
|
||||
}
|
||||
|
||||
GfxInvalidateScreen();
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace OpenRCT2::GameActions
|
||||
if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull())
|
||||
{
|
||||
LOG_ERROR("Invalid sprite index %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
auto* staff = getGameState().entities.TryGetEntity<Staff>(_spriteIndex);
|
||||
@@ -57,7 +57,7 @@ namespace OpenRCT2::GameActions
|
||||
|| (staff->AssignedStaffType != StaffType::handyman && staff->AssignedStaffType != StaffType::mechanic))
|
||||
{
|
||||
LOG_ERROR("Staff orders can't be changed for staff of type %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE);
|
||||
}
|
||||
|
||||
return Result();
|
||||
@@ -69,7 +69,7 @@ namespace OpenRCT2::GameActions
|
||||
if (staff == nullptr)
|
||||
{
|
||||
LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
}
|
||||
staff->StaffOrders = _ordersId;
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace OpenRCT2::GameActions
|
||||
if (staff == nullptr)
|
||||
{
|
||||
LOG_ERROR("Staff entity not found for spriteID %u", _spriteId.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto validRange = ClampRangeWithinMap(_range);
|
||||
@@ -76,7 +76,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (!LocationValid({ x, y }))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_SET_PATROL_AREA, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_SET_PATROL_AREA, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceObj == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid surface style %u", _surfaceStyle);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace OpenRCT2::GameActions
|
||||
if (edgeObj == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid edge style %u", _edgeStyle);
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace OpenRCT2::GameActions
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode
|
||||
&& (gameState.park.flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES))
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_CHANGE_LAND_TYPE, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY);
|
||||
return Result(Status::disallowed, STR_CANT_CHANGE_LAND_TYPE, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY);
|
||||
}
|
||||
|
||||
money64 surfaceCost = 0;
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
auto res = Result();
|
||||
switch (_setting)
|
||||
@@ -240,7 +240,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
default:
|
||||
LOG_ERROR("Invalid tile modification type %u", _setting);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
res.Position.x = _loc.x;
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
auto& objManager = GetContext()->GetObjectManager();
|
||||
@@ -83,9 +83,9 @@ namespace OpenRCT2::GameActions
|
||||
auto rideCreateAction = RideCreateAction(_td.trackAndVehicle.rtdIndex, entryIndex, 0, 0, gameState.lastEntranceStyle);
|
||||
rideCreateAction.SetFlags(GetFlags());
|
||||
auto r = ExecuteNested(&rideCreateAction, gameState);
|
||||
if (r.Error != Status::Ok)
|
||||
if (r.Error != Status::ok)
|
||||
{
|
||||
return Result(Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone);
|
||||
return Result(Status::noFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone);
|
||||
}
|
||||
|
||||
const auto rideIndex = r.GetData<RideId>();
|
||||
@@ -93,7 +93,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %d", rideIndex);
|
||||
return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
bool placeScenery = _placeScenery;
|
||||
@@ -114,7 +114,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
ExecuteNested(&gameAction, gameState);
|
||||
|
||||
if (queryRes.Error != Status::Ok)
|
||||
if (queryRes.Error != Status::ok)
|
||||
{
|
||||
res.Error = queryRes.Error;
|
||||
res.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
@@ -153,9 +153,9 @@ namespace OpenRCT2::GameActions
|
||||
auto rideCreateAction = RideCreateAction(_td.trackAndVehicle.rtdIndex, entryIndex, 0, 0, gameState.lastEntranceStyle);
|
||||
rideCreateAction.SetFlags(GetFlags());
|
||||
auto r = ExecuteNested(&rideCreateAction, gameState);
|
||||
if (r.Error != Status::Ok)
|
||||
if (r.Error != Status::ok)
|
||||
{
|
||||
return Result(Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone);
|
||||
return Result(Status::noFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone);
|
||||
}
|
||||
|
||||
const auto rideIndex = r.GetData<RideId>();
|
||||
@@ -163,7 +163,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %d", rideIndex);
|
||||
return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(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.
|
||||
@@ -178,7 +178,7 @@ namespace OpenRCT2::GameActions
|
||||
queryRes = TrackDesignPlace(_td, flags, placeScenery, *ride, _loc);
|
||||
}
|
||||
|
||||
if (queryRes.Error != Status::Ok)
|
||||
if (queryRes.Error != Status::ok)
|
||||
{
|
||||
auto gameAction = RideDemolishAction(ride->id, RideModifyType::demolish);
|
||||
gameAction.SetFlags(GetFlags());
|
||||
@@ -196,7 +196,7 @@ namespace OpenRCT2::GameActions
|
||||
flags.set(CommandFlag::apply);
|
||||
|
||||
auto execRes = TrackDesignPlace(_td, flags, placeScenery, *ride, _loc);
|
||||
if (execRes.Error != Status::Ok)
|
||||
if (execRes.Error != Status::ok)
|
||||
{
|
||||
auto gameAction = RideDemolishAction(ride->id, RideModifyType::demolish);
|
||||
gameAction.SetFlags(GetFlags());
|
||||
@@ -259,7 +259,7 @@ namespace OpenRCT2::GameActions
|
||||
ride->vehicleColours[i] = _td.appearance.vehicleColours[i];
|
||||
}
|
||||
|
||||
for (int32_t count = 1; count == 1 || r.Error != Status::Ok; ++count)
|
||||
for (int32_t count = 1; count == 1 || r.Error != Status::ok; ++count)
|
||||
{
|
||||
auto name = count == 1 ? _td.gameStateData.name : (_td.gameStateData.name + " " + std::to_string(count));
|
||||
auto gameAction = RideSetNameAction(ride->id, name);
|
||||
|
||||
@@ -83,38 +83,38 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %d", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
const auto* rideEntry = GetRideEntryByIndex(ride->subtype);
|
||||
if (rideEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
if (!DirectionValid(_origin.direction))
|
||||
{
|
||||
LOG_ERROR("Invalid direction for track placement, direction = %d", _origin.direction);
|
||||
return Result(
|
||||
Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
if (_rideType != ride->type && !gameState.cheats.allowArbitraryRideTypeChanges)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
if (_rideType > RIDE_TYPE_COUNT)
|
||||
{
|
||||
LOG_ERROR("Invalid ride type for track placement, rideType = %d", _rideType);
|
||||
return Result(
|
||||
Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
if (_brakeSpeed > kMaximumTrackSpeed)
|
||||
{
|
||||
LOG_WARNING("Invalid speed for track placement, speed = %d", _brakeSpeed);
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_SPEED_TOO_HIGH);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_SPEED_TOO_HIGH);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -130,7 +130,7 @@ namespace OpenRCT2::GameActions
|
||||
if ((ride->lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && _trackType == TrackElemType::EndStation)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NOT_ALLOWED_TO_MODIFY_STATION);
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NOT_ALLOWED_TO_MODIFY_STATION);
|
||||
}
|
||||
|
||||
if (!(GetActionFlags() & Flags::AllowWhilePaused))
|
||||
@@ -138,7 +138,7 @@ namespace OpenRCT2::GameActions
|
||||
if (GameIsPaused() && !gameState.cheats.buildInPauseMode)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED);
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride->lifecycleFlags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
STR_ONLY_ONE_ON_RIDE_PHOTO_PER_RIDE);
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride->lifecycleFlags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
STR_ONLY_ONE_CABLE_LIFT_HILL_PER_RIDE);
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ted.flags & TRACK_ELEM_FLAG_IS_STEEP_UP)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_STEEP_FOR_LIFT_HILL);
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_STEEP_FOR_LIFT_HILL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,11 +187,11 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(tileCoords))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
if (!MapIsLocationOwned(tileCoords) && !gameState.cheats.sandboxMode)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
numElements++;
|
||||
}
|
||||
@@ -200,7 +200,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
LOG_ERROR("Not enough free map elements to place track.");
|
||||
return Result(
|
||||
Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
Status::noFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
||||
if (!gameState.cheats.allowTrackPlaceInvalidHeights)
|
||||
@@ -210,7 +210,7 @@ namespace OpenRCT2::GameActions
|
||||
if ((_origin.z & 0x0F) != 8)
|
||||
{
|
||||
return Result(
|
||||
Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_INVALID_HEIGHT);
|
||||
Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_INVALID_HEIGHT);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -218,7 +218,7 @@ namespace OpenRCT2::GameActions
|
||||
if ((_origin.z & 0x0F) != 0)
|
||||
{
|
||||
return Result(
|
||||
Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_INVALID_HEIGHT);
|
||||
Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_INVALID_HEIGHT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -237,7 +237,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (mapLoc.z < 16)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_LOW);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_LOW);
|
||||
}
|
||||
|
||||
int32_t baseZ = floor2(mapLoc.z, kCoordsZStep);
|
||||
@@ -256,7 +256,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (clearanceZ > MAX_TRACK_HEIGHT)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH);
|
||||
}
|
||||
|
||||
auto crossingMode = (rtd.HasFlag(RtdFlag::supportsLevelCrossings) && _trackType == TrackElemType::Flat)
|
||||
@@ -265,7 +265,7 @@ namespace OpenRCT2::GameActions
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
{ mapLoc, baseZ, clearanceZ }, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags(), kTileSlopeFlat,
|
||||
crossingMode);
|
||||
if (canBuild.Error != Status::Ok)
|
||||
if (canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
return canBuild;
|
||||
@@ -279,7 +279,7 @@ namespace OpenRCT2::GameActions
|
||||
if (resultData.GroundFlags != 0 && (resultData.GroundFlags & mapGroundFlags) == 0)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND);
|
||||
}
|
||||
}
|
||||
@@ -290,7 +290,7 @@ namespace OpenRCT2::GameActions
|
||||
if (resultData.GroundFlags & ELEMENT_IS_UNDERGROUND)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
|
||||
}
|
||||
}
|
||||
@@ -300,14 +300,14 @@ namespace OpenRCT2::GameActions
|
||||
if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_UNDERWATER);
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_UNDERWATER);
|
||||
}
|
||||
}
|
||||
|
||||
if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_RIDE_CANT_BUILD_THIS_UNDERWATER);
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_RIDE_CANT_BUILD_THIS_UNDERWATER);
|
||||
}
|
||||
|
||||
if (rtd.HasFlag(RtdFlag::trackMustBeOnWater) && !_trackDesignDrawingPreview)
|
||||
@@ -316,20 +316,20 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
return Result(
|
||||
Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
Status::unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto waterHeight = surfaceElement->GetWaterHeight();
|
||||
if (waterHeight == 0)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_WATER);
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_WATER);
|
||||
}
|
||||
|
||||
if (waterHeight != baseZ)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_WATER);
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_WATER);
|
||||
}
|
||||
waterHeight -= kLandHeightStep;
|
||||
if (waterHeight == surfaceElement->GetBaseZ())
|
||||
@@ -339,7 +339,7 @@ namespace OpenRCT2::GameActions
|
||||
|| slope == kTileSlopeNCornerDown)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
STR_CAN_ONLY_BUILD_THIS_ON_WATER);
|
||||
}
|
||||
}
|
||||
@@ -352,7 +352,7 @@ namespace OpenRCT2::GameActions
|
||||
{ mapLoc, baseZ, _origin.direction }, _rideIndex, {}, _fromTrackDesign);
|
||||
if (!addElementResult.Successful)
|
||||
{
|
||||
return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, addElementResult.Message);
|
||||
return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, addElementResult.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
return Result(
|
||||
Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
Status::unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (!gameState.cheats.disableSupportLimits)
|
||||
@@ -384,7 +384,7 @@ namespace OpenRCT2::GameActions
|
||||
if (ride_height > maxHeight && !_trackDesignDrawingPreview)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH_FOR_SUPPORTS);
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH_FOR_SUPPORTS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -414,14 +414,14 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
const auto* rideEntry = GetRideEntryByIndex(ride->subtype);
|
||||
if (rideEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying());
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
auto res = Result();
|
||||
@@ -470,7 +470,7 @@ namespace OpenRCT2::GameActions
|
||||
auto canBuild = MapCanConstructWithClearAt(
|
||||
mapLocWithClearance, MapPlaceNonSceneryClearFunc, quarterTile, GetFlags().with(CommandFlag::apply),
|
||||
kTileSlopeFlat, crossingMode);
|
||||
if (canBuild.Error != Status::Ok)
|
||||
if (canBuild.Error != Status::ok)
|
||||
{
|
||||
canBuild.ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
return canBuild;
|
||||
@@ -517,7 +517,7 @@ namespace OpenRCT2::GameActions
|
||||
if (resultData.GroundFlags != 0 && (resultData.GroundFlags & mapGroundFlags) == 0)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE,
|
||||
STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND);
|
||||
}
|
||||
}
|
||||
@@ -529,7 +529,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
return Result(
|
||||
Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
Status::unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
int32_t supportHeight = baseZ - surfaceElement->GetBaseZ();
|
||||
@@ -559,7 +559,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
LOG_ERROR("Cannot create track element for ride = %d", _rideIndex.ToUnderlying());
|
||||
return Result(
|
||||
Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
Status::noFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
||||
trackElement->SetClearanceZ(clearanceZ);
|
||||
|
||||
@@ -113,13 +113,13 @@ namespace OpenRCT2::GameActions
|
||||
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 Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (tileElement->AsTrack()->IsIndestructible())
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_YOU_ARE_NOT_ALLOWED_TO_REMOVE_THIS_SECTION);
|
||||
Status::disallowed, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_YOU_ARE_NOT_ALLOWED_TO_REMOVE_THIS_SECTION);
|
||||
}
|
||||
|
||||
RideId rideIndex = tileElement->AsTrack()->GetRideIndex();
|
||||
@@ -129,20 +129,20 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %d.", rideIndex);
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (ride->type >= RIDE_TYPE_COUNT)
|
||||
{
|
||||
LOG_ERROR("Ride type not found. ride type = %d.", ride->type);
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
auto sequenceIndex = tileElement->AsTrack()->GetSequenceIndex();
|
||||
if (sequenceIndex >= ted.numSequences)
|
||||
{
|
||||
LOG_ERROR("Track block %d not found for track type %d.", sequenceIndex, trackType);
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_BLOCK_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_BLOCK_NOT_FOUND);
|
||||
}
|
||||
const auto& currentTrackBlock = ted.sequences[sequenceIndex].clearance;
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(mapLoc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
MapInvalidateTileFull(mapLoc);
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace OpenRCT2::GameActions
|
||||
LOG_ERROR(
|
||||
"Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", mapLoc.x, mapLoc.y, mapLoc.z,
|
||||
_origin.direction, i);
|
||||
return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
int32_t entranceDirections = ted.sequences[0].flags;
|
||||
@@ -215,7 +215,7 @@ namespace OpenRCT2::GameActions
|
||||
const auto removeElementResult = TrackRemoveStationElement({ mapLoc, _origin.direction }, rideIndex, {});
|
||||
if (!removeElementResult.Successful)
|
||||
{
|
||||
return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message);
|
||||
return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y);
|
||||
return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
int16_t _support_height = tileElement->BaseHeight - surfaceElement->BaseHeight;
|
||||
@@ -297,7 +297,7 @@ namespace OpenRCT2::GameActions
|
||||
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 Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
RideId rideIndex = tileElement->AsTrack()->GetRideIndex();
|
||||
@@ -308,14 +308,14 @@ namespace OpenRCT2::GameActions
|
||||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found. ride index = %d.", rideIndex);
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
auto sequenceIndex = tileElement->AsTrack()->GetSequenceIndex();
|
||||
if (sequenceIndex >= ted.numSequences)
|
||||
{
|
||||
LOG_ERROR("Track block %d not found for track type %d.", sequenceIndex, trackType);
|
||||
return Result(Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_BLOCK_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_BLOCK_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto startLoc = _origin;
|
||||
@@ -376,7 +376,7 @@ namespace OpenRCT2::GameActions
|
||||
LOG_ERROR(
|
||||
"Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", mapLoc.x, mapLoc.y, mapLoc.z,
|
||||
_origin.direction, i);
|
||||
return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
int32_t entranceDirections = ted.sequences[0].flags;
|
||||
@@ -385,7 +385,7 @@ namespace OpenRCT2::GameActions
|
||||
const auto removeElementResult = TrackRemoveStationElement({ mapLoc, _origin.direction }, rideIndex, {});
|
||||
if (!removeElementResult.Successful)
|
||||
{
|
||||
return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message);
|
||||
return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y);
|
||||
return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
int16_t _support_height = tileElement->BaseHeight - surfaceElement->BaseHeight;
|
||||
@@ -414,7 +414,7 @@ namespace OpenRCT2::GameActions
|
||||
{ mapLoc, _origin.direction }, rideIndex, { CommandFlag::apply });
|
||||
if (!removeElementResult.Successful)
|
||||
{
|
||||
return Result(Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message);
|
||||
return Result(Status::unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, removeElementResult.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,20 +64,20 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_CHANGE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
TileElement* tileElement = MapGetTrackElementAtOfType(_loc, _trackType);
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Track element of type %u not found at x = %d, y = %d, z = %d", _trackType, _loc.x, _loc.y, _loc.z);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (_brakeSpeed > kMaximumTrackSpeed)
|
||||
{
|
||||
LOG_WARNING("Invalid speed for track, speed = %d", _brakeSpeed);
|
||||
return Result(Status::InvalidParameters, STR_SPEED_TOO_HIGH, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_SPEED_TOO_HIGH, kStringIdNone);
|
||||
}
|
||||
|
||||
if (isExecuting)
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
auto mapSizeMax = GetMapSizeMaxXY();
|
||||
@@ -99,23 +99,23 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (!MapIsLocationInPark(_loc))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
}
|
||||
else if (!MapIsLocationOwned(_loc))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
}
|
||||
else if (!_trackDesignDrawingPreview && (_loc.x > mapSizeMax.x || _loc.y > mapSizeMax.y))
|
||||
{
|
||||
LOG_ERROR("Invalid x/y coordinates. x = %d y = %d", _loc.x, _loc.y);
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (_edge > 3)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
uint8_t edgeSlope = 0;
|
||||
@@ -126,7 +126,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y);
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
targetHeight = surfaceElement->GetBaseZ();
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y);
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (surfaceElement->GetWaterHeight() > 0)
|
||||
@@ -152,13 +152,13 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (targetHeight < waterHeight && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER);
|
||||
}
|
||||
}
|
||||
|
||||
if (targetHeight < surfaceElement->GetBaseZ() && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
|
||||
}
|
||||
|
||||
if (!(edgeSlope & (EDGE_SLOPE_UPWARDS | EDGE_SLOPE_DOWNWARDS)))
|
||||
@@ -170,7 +170,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
|
||||
}
|
||||
|
||||
if (surfaceElement->GetSlope() & kTileSlopeDiagonalFlag)
|
||||
@@ -186,7 +186,7 @@ namespace OpenRCT2::GameActions
|
||||
if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
|
||||
Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
|
||||
}
|
||||
newBaseHeight -= 2;
|
||||
}
|
||||
@@ -199,7 +199,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
|
||||
}
|
||||
|
||||
if (surfaceElement->GetSlope() & kTileSlopeDiagonalFlag)
|
||||
@@ -215,7 +215,7 @@ namespace OpenRCT2::GameActions
|
||||
if (targetHeight / 8 < newBaseHeight && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
return Result(
|
||||
Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
|
||||
Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,7 +228,7 @@ namespace OpenRCT2::GameActions
|
||||
if (wallEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Wall Type not found %d", _wallType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
if (wallEntry->scrolling_mode != kScrollingModeNone)
|
||||
@@ -236,7 +236,7 @@ namespace OpenRCT2::GameActions
|
||||
if (HasReachedBannerLimit())
|
||||
{
|
||||
LOG_ERROR("No free banners available");
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (wallEntry->flags & WALL_SCENERY_CANT_BUILD_ON_SLOPE)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_ERR_UNABLE_TO_BUILD_THIS_ON_SLOPE);
|
||||
return Result(Status::disallowed, STR_CANT_BUILD_THIS_HERE, STR_ERR_UNABLE_TO_BUILD_THIS_ON_SLOPE);
|
||||
}
|
||||
clearanceHeight += 2;
|
||||
}
|
||||
@@ -255,7 +255,7 @@ namespace OpenRCT2::GameActions
|
||||
if (!(GetFlags().has(CommandFlag::trackDesign)) && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
auto result = WallCheckObstruction(wallEntry, targetHeight / 8, clearanceHeight, &wallAcrossTrack);
|
||||
if (result.Error != Status::Ok)
|
||||
if (result.Error != Status::ok)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@@ -263,7 +263,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!MapCheckCapacityAndReorganise(_loc))
|
||||
{
|
||||
return Result(Status::NoFreeElements, STR_CANT_BUILD_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
return Result(Status::noFreeElements, STR_CANT_BUILD_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
||||
res.Cost = wallEntry->price;
|
||||
@@ -296,7 +296,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y);
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
targetHeight = surfaceElement->GetBaseZ();
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace OpenRCT2::GameActions
|
||||
if (wallEntry == nullptr)
|
||||
{
|
||||
LOG_ERROR("Wall Type not found %d", _wallType);
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
uint8_t clearanceHeight = targetHeight / kCoordsZStep;
|
||||
@@ -329,7 +329,7 @@ namespace OpenRCT2::GameActions
|
||||
if (!(GetFlags().has(CommandFlag::trackDesign)) && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
auto result = WallCheckObstruction(wallEntry, targetHeight / kCoordsZStep, clearanceHeight, &wallAcrossTrack);
|
||||
if (result.Error != Status::Ok)
|
||||
if (result.Error != Status::ok)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@@ -342,7 +342,7 @@ namespace OpenRCT2::GameActions
|
||||
if (banner == nullptr)
|
||||
{
|
||||
LOG_ERROR("No free banners available");
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
|
||||
banner->text = {};
|
||||
@@ -363,7 +363,7 @@ namespace OpenRCT2::GameActions
|
||||
auto* wallElement = TileElementInsert<WallElement>(targetLoc, 0b0000);
|
||||
if (wallElement == nullptr)
|
||||
{
|
||||
return Result(Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
return Result(Status::noFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
||||
wallElement->ClearanceHeight = clearanceHeight;
|
||||
@@ -499,7 +499,7 @@ namespace OpenRCT2::GameActions
|
||||
*wallAcrossTrack = false;
|
||||
if (MapIsEdge(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
TileElement* tileElement = MapGetFirstElementAt(_loc);
|
||||
@@ -521,7 +521,7 @@ namespace OpenRCT2::GameActions
|
||||
int32_t direction = tileElement->GetDirection();
|
||||
if (_edge == direction)
|
||||
{
|
||||
auto res = Result(Status::NoClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone);
|
||||
auto res = Result(Status::noClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone);
|
||||
MapGetObstructionErrorText(tileElement, res);
|
||||
return res;
|
||||
}
|
||||
@@ -529,7 +529,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
if (tileElement->GetOccupiedQuadrants() == 0)
|
||||
continue;
|
||||
auto res = Result(Status::NoClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone);
|
||||
auto res = Result(Status::noClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone);
|
||||
switch (elementType)
|
||||
{
|
||||
case TileElementType::Entrance:
|
||||
|
||||
@@ -47,20 +47,20 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
const bool isGhost = GetFlags().has(CommandFlag::ghost);
|
||||
if (!isGhost && gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode
|
||||
&& !MapIsLocationOwned(_loc))
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
TileElement* wallElement = GetFirstWallElementAt(_loc, isGhost);
|
||||
if (wallElement == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
}
|
||||
|
||||
res.Cost = 0;
|
||||
@@ -78,7 +78,7 @@ namespace OpenRCT2::GameActions
|
||||
TileElement* wallElement = GetFirstWallElementAt(_loc, isGhost);
|
||||
if (wallElement == nullptr)
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
return Result(Status::invalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
}
|
||||
|
||||
res.Position.x = _loc.x + 16;
|
||||
|
||||
@@ -64,12 +64,12 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP);
|
||||
}
|
||||
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !MapIsLocationInPark(_loc) && !getGameState().cheats.sandboxMode)
|
||||
{
|
||||
return Result(Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
auto wallElement = MapGetWallElementAt(_loc);
|
||||
@@ -78,7 +78,7 @@ namespace OpenRCT2::GameActions
|
||||
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 Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_WALL_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_WALL_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
if ((GetFlags().has(CommandFlag::ghost)) && !(wallElement->IsGhost()))
|
||||
@@ -92,25 +92,25 @@ namespace OpenRCT2::GameActions
|
||||
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 Result(Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::unknown, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
if (_primaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
LOG_ERROR("Primary colour invalid: colour = %d", _primaryColour);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
else if (_secondaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
LOG_ERROR("Secondary colour invalid: colour = %d", _secondaryColour);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR);
|
||||
}
|
||||
else if (wallEntry->flags & WALL_SCENERY_HAS_TERTIARY_COLOUR)
|
||||
{
|
||||
if (_tertiaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
LOG_ERROR("Tertiary colour invalid: colour = %d", _tertiaryColour);
|
||||
return Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
@@ -131,7 +131,7 @@ namespace OpenRCT2::GameActions
|
||||
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 Result(Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::invalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
if ((GetFlags().has(CommandFlag::ghost)) && !(wallElement->IsGhost()))
|
||||
@@ -145,7 +145,7 @@ namespace OpenRCT2::GameActions
|
||||
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 Result(Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
return Result(Status::unknown, STR_CANT_REPAINT_THIS, kStringIdNone);
|
||||
}
|
||||
|
||||
wallElement->SetPrimaryColour(_primaryColour);
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace OpenRCT2::GameActions
|
||||
waterSetHeightAction.SetFlags(GetFlags());
|
||||
auto result = isExecuting ? ExecuteNested(&waterSetHeightAction, gameState)
|
||||
: QueryNested(&waterSetHeightAction, gameState);
|
||||
if (result.Error == Status::Ok)
|
||||
if (result.Error == Status::ok)
|
||||
{
|
||||
res.Cost += result.Cost;
|
||||
hasChanged = true;
|
||||
@@ -117,7 +117,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!withinOwnership)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_LOWER_WATER_LEVEL_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::disallowed, STR_CANT_LOWER_WATER_LEVEL_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace OpenRCT2::GameActions
|
||||
waterSetHeightAction.SetFlags(GetFlags());
|
||||
auto result = isExecuting ? ExecuteNested(&waterSetHeightAction, gameState)
|
||||
: QueryNested(&waterSetHeightAction, gameState);
|
||||
if (result.Error == Status::Ok)
|
||||
if (result.Error == Status::ok)
|
||||
{
|
||||
res.Cost += result.Cost;
|
||||
hasChanged = true;
|
||||
@@ -131,7 +131,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (!withinOwnership)
|
||||
{
|
||||
return Result(Status::Disallowed, STR_CANT_RAISE_WATER_LEVEL_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::disallowed, STR_CANT_RAISE_WATER_LEVEL_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
if (isExecuting && hasChanged)
|
||||
|
||||
@@ -55,25 +55,25 @@ namespace OpenRCT2::GameActions
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode
|
||||
&& gameState.park.flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES)
|
||||
{
|
||||
return Result(Status::Disallowed, kStringIdNone, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY);
|
||||
return Result(Status::disallowed, kStringIdNone, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY);
|
||||
}
|
||||
|
||||
StringId errorMsg = CheckParameters();
|
||||
if (errorMsg != kStringIdNone)
|
||||
{
|
||||
return Result(Status::InvalidParameters, kStringIdNone, errorMsg);
|
||||
return Result(Status::invalidParameters, kStringIdNone, errorMsg);
|
||||
}
|
||||
|
||||
if (!LocationValid(_coords))
|
||||
{
|
||||
return Result(Status::NotOwned, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::notOwned, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !gameState.cheats.sandboxMode)
|
||||
{
|
||||
if (!MapIsLocationInPark(_coords))
|
||||
{
|
||||
return Result(Status::Disallowed, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return Result(Status::disallowed, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No surface element at: x %u, y %u", _coords.x, _coords.y);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
int32_t zHigh = surfaceElement->GetBaseZ();
|
||||
@@ -97,13 +97,13 @@ namespace OpenRCT2::GameActions
|
||||
zLow = temp;
|
||||
}
|
||||
|
||||
if (auto res2 = MapCanConstructAt({ _coords, zLow, zHigh }, { 0b1111, 0b1111 }); res2.Error != Status::Ok)
|
||||
if (auto res2 = MapCanConstructAt({ _coords, zLow, zHigh }, { 0b1111, 0b1111 }); res2.Error != Status::ok)
|
||||
{
|
||||
return res2;
|
||||
}
|
||||
if (surfaceElement->HasTrackThatNeedsWater())
|
||||
{
|
||||
return Result(Status::Disallowed, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ON_THIS_TILE_NEEDS_WATER);
|
||||
return Result(Status::disallowed, STR_ERR_INVALID_PARAMETER, STR_ERR_TRACK_ON_THIS_TILE_NEEDS_WATER);
|
||||
}
|
||||
|
||||
res.Cost = 250;
|
||||
@@ -126,7 +126,7 @@ namespace OpenRCT2::GameActions
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("No surface element at: x %u, y %u", _coords.x, _coords.y);
|
||||
return Result(Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
return Result(Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (_height > surfaceElement->BaseHeight)
|
||||
|
||||
@@ -660,7 +660,7 @@ void Peep::PickupAbort(int32_t old_x)
|
||||
gPickupPeepImage = ImageId();
|
||||
}
|
||||
|
||||
// Returns GameActions::Status::OK when a peep can be dropped at the given location. When apply is set to true the peep gets
|
||||
// Returns GameActions::Status::ok when a peep can be dropped at the given location. When apply is set to true the peep gets
|
||||
// dropped.
|
||||
GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply)
|
||||
{
|
||||
@@ -672,7 +672,7 @@ GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply)
|
||||
}
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
return GameActions::Result(GameActions::Status::invalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone);
|
||||
}
|
||||
|
||||
// Set the coordinate of destination to be exactly
|
||||
@@ -681,17 +681,17 @@ GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply)
|
||||
|
||||
if (!MapIsLocationOwned(destination))
|
||||
{
|
||||
return GameActions::Result(GameActions::Status::NotOwned, STR_ERR_CANT_PLACE_PERSON_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
return GameActions::Result(GameActions::Status::notOwned, STR_ERR_CANT_PLACE_PERSON_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
||||
if (auto res = MapCanConstructAt({ destination, destination.z, destination.z + (1 * 8) }, { 0b1111, 0 });
|
||||
res.Error != GameActions::Status::Ok)
|
||||
res.Error != GameActions::Status::ok)
|
||||
{
|
||||
const auto stringId = std::get<StringId>(res.ErrorMessage);
|
||||
if (stringId != STR_RAISE_OR_LOWER_LAND_FIRST && stringId != STR_FOOTPATH_IN_THE_WAY)
|
||||
{
|
||||
return GameActions::Result(
|
||||
GameActions::Status::NoClearance, STR_ERR_CANT_PLACE_PERSON_HERE, stringId, res.ErrorMessageArgs.data());
|
||||
GameActions::Status::noClearance, STR_ERR_CANT_PLACE_PERSON_HERE, stringId, res.ErrorMessageArgs.data());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1005,7 +1005,7 @@ GameActions::Result StaffSetColour(StaffType staffType, colour_t value)
|
||||
break;
|
||||
default:
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE);
|
||||
GameActions::Status::invalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE);
|
||||
}
|
||||
return GameActions::Result();
|
||||
}
|
||||
|
||||
Loaded 100 of 110 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user