mirror of https://github.com/OpenRCT2/OpenRCT2.git
Create Ride::ChangeStatusCheckCompleteCircuit()
Co-authored-by: spacek531 <spacek531@users.noreply.github.com>
This commit is contained in:
parent
079d99d7b2
commit
4f48ccc5c8
|
@ -3998,16 +3998,13 @@ ResultWithMessage Ride::Open(bool isApplying)
|
||||||
return { false };
|
return { false };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == RideMode::Race || mode == RideMode::ContinuousCircuit || IsBlockSectioned())
|
auto message = ChangeStatusCheckCompleteCircuit(trackElement);
|
||||||
|
if (!message.Successful)
|
||||||
{
|
{
|
||||||
if (FindTrackGap(trackElement, &problematicTrackElement))
|
return message;
|
||||||
{
|
|
||||||
ride_scroll_to_track_error(problematicTrackElement);
|
|
||||||
return { false, STR_TRACK_IS_NOT_A_COMPLETE_CIRCUIT };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto message = ChangeStatusCheckTrackValidity(trackElement);
|
message = ChangeStatusCheckTrackValidity(trackElement);
|
||||||
if (!message.Successful)
|
if (!message.Successful)
|
||||||
{
|
{
|
||||||
return message;
|
return message;
|
||||||
|
@ -5796,6 +5793,21 @@ std::vector<RideId> GetTracklessRides()
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ResultWithMessage Ride::ChangeStatusCheckCompleteCircuit(const CoordsXYE& trackElement)
|
||||||
|
{
|
||||||
|
CoordsXYE problematicTrackElement = {};
|
||||||
|
if (mode == RideMode::Race || mode == RideMode::ContinuousCircuit || IsBlockSectioned())
|
||||||
|
{
|
||||||
|
if (FindTrackGap(trackElement, &problematicTrackElement))
|
||||||
|
{
|
||||||
|
ride_scroll_to_track_error(problematicTrackElement);
|
||||||
|
return { false, STR_TRACK_IS_NOT_A_COMPLETE_CIRCUIT };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { true };
|
||||||
|
}
|
||||||
|
|
||||||
ResultWithMessage Ride::ChangeStatusCheckTrackValidity(const CoordsXYE& trackElement)
|
ResultWithMessage Ride::ChangeStatusCheckTrackValidity(const CoordsXYE& trackElement)
|
||||||
{
|
{
|
||||||
CoordsXYE problematicTrackElement = {};
|
CoordsXYE problematicTrackElement = {};
|
||||||
|
|
|
@ -309,6 +309,7 @@ private:
|
||||||
void ChainQueues() const;
|
void ChainQueues() const;
|
||||||
void ConstructMissingEntranceOrExit() const;
|
void ConstructMissingEntranceOrExit() const;
|
||||||
|
|
||||||
|
ResultWithMessage ChangeStatusCheckCompleteCircuit(const CoordsXYE& trackElement);
|
||||||
ResultWithMessage ChangeStatusCheckTrackValidity(const CoordsXYE& trackElement);
|
ResultWithMessage ChangeStatusCheckTrackValidity(const CoordsXYE& trackElement);
|
||||||
ResultWithMessage ChangeStatusCreateVehicles(bool isApplying, const CoordsXYE& trackElement);
|
ResultWithMessage ChangeStatusCreateVehicles(bool isApplying, const CoordsXYE& trackElement);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue