mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 18:31:59 -05:00
Create Ride::ChangeStatusCheckCompleteCircuit()
Co-authored-by: spacek531 <spacek531@users.noreply.github.com>
This commit is contained in:
parent
079d99d7b2
commit
4f48ccc5c8
2 changed files with 20 additions and 7 deletions
|
@ -3998,16 +3998,13 @@ ResultWithMessage Ride::Open(bool isApplying)
|
|||
return { false };
|
||||
}
|
||||
|
||||
if (mode == RideMode::Race || mode == RideMode::ContinuousCircuit || IsBlockSectioned())
|
||||
auto message = ChangeStatusCheckCompleteCircuit(trackElement);
|
||||
if (!message.Successful)
|
||||
{
|
||||
if (FindTrackGap(trackElement, &problematicTrackElement))
|
||||
{
|
||||
ride_scroll_to_track_error(problematicTrackElement);
|
||||
return { false, STR_TRACK_IS_NOT_A_COMPLETE_CIRCUIT };
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
auto message = ChangeStatusCheckTrackValidity(trackElement);
|
||||
message = ChangeStatusCheckTrackValidity(trackElement);
|
||||
if (!message.Successful)
|
||||
{
|
||||
return message;
|
||||
|
@ -5796,6 +5793,21 @@ std::vector<RideId> GetTracklessRides()
|
|||
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)
|
||||
{
|
||||
CoordsXYE problematicTrackElement = {};
|
||||
|
|
|
@ -309,6 +309,7 @@ private:
|
|||
void ChainQueues() const;
|
||||
void ConstructMissingEntranceOrExit() const;
|
||||
|
||||
ResultWithMessage ChangeStatusCheckCompleteCircuit(const CoordsXYE& trackElement);
|
||||
ResultWithMessage ChangeStatusCheckTrackValidity(const CoordsXYE& trackElement);
|
||||
ResultWithMessage ChangeStatusCreateVehicles(bool isApplying, const CoordsXYE& trackElement);
|
||||
|
||||
|
|
Loading…
Reference in a new issue