mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use `STR_ERR_RIDE_NOT_FOUND` when `ride==nullptr`
This commit is contained in:
parent
13abc3441c
commit
87ee06b7a4
|
@ -61,7 +61,7 @@ GameActions::Result RideDemolishAction::Query() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if ((ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK)
|
||||
|
@ -106,7 +106,7 @@ GameActions::Result RideDemolishAction::Execute() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
switch (_modifyType)
|
||||
|
|
|
@ -59,7 +59,7 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (_stationNum.ToUnderlying() >= Limits::MaxStationsPerRide)
|
||||
|
@ -144,7 +144,7 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
|
||||
|
|
|
@ -51,7 +51,8 @@ GameActions::Result RideSetNameAction::Query() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (!_name.empty() && Ride::NameExists(_name, ride->id))
|
||||
|
@ -69,7 +70,8 @@ GameActions::Result RideSetNameAction::Execute() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (_name.empty())
|
||||
|
|
|
@ -63,7 +63,7 @@ GameActions::Result RideSetStatusAction::Query() const
|
|||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
res.Error = GameActions::Status::InvalidParameters;
|
||||
res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
|
||||
res.ErrorMessage = STR_NONE;
|
||||
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ GameActions::Result RideSetStatusAction::Execute() const
|
|||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
res.Error = GameActions::Status::InvalidParameters;
|
||||
res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
|
||||
res.ErrorMessage = STR_NONE;
|
||||
res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ GameActions::Result RideSetVehicleAction::Query() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)
|
||||
|
@ -132,7 +132,7 @@ GameActions::Result RideSetVehicleAction::Execute() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying());
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
switch (_type)
|
||||
|
|
|
@ -91,7 +91,8 @@ GameActions::Result TrackDesignAction::Query() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %d", rideIndex);
|
||||
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
bool placeScenery = true;
|
||||
|
@ -164,7 +165,8 @@ GameActions::Result TrackDesignAction::Execute() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found for rideIndex %d", rideIndex);
|
||||
return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE);
|
||||
return GameActions::Result(
|
||||
GameActions::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.
|
||||
|
|
|
@ -130,7 +130,8 @@ GameActions::Result TrackRemoveAction::Query() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found. ride index = %d.", rideIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (ride->type >= RIDE_TYPE_COUNT)
|
||||
|
@ -325,7 +326,8 @@ GameActions::Result TrackRemoveAction::Execute() const
|
|||
if (ride == nullptr)
|
||||
{
|
||||
LOG_ERROR("Ride not found. ride index = %d.", rideIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
auto sequenceIndex = tileElement->AsTrack()->GetSequenceIndex();
|
||||
|
|
Loading…
Reference in New Issue