1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-03 18:07:53 +01:00

Reduce direct ride type checking; move available piece lookup to RTD (#11353)

This commit is contained in:
Michael Steenbeek
2020-04-19 13:32:43 +02:00
committed by GitHub
parent d17b4606f3
commit 8127437de1
12 changed files with 42 additions and 41 deletions

View File

@@ -19,6 +19,7 @@
#include "RideData.h"
#include "../Cheats.h"
#include "../audio/audio.h"
#include "../interface/Colour.h"
#include "../localisation/Localisation.h"
@@ -2505,3 +2506,17 @@ bool RideTypeDescriptor::HasFlag(uint64_t flag) const
{
return Flags & flag;
}
uint64_t RideTypeDescriptor::GetAvailableTrackPieces() const
{
if (gCheatsEnableAllDrawableTrackPieces)
{
return EnabledTrackPieces | ExtraTrackPieces;
}
return EnabledTrackPieces;
}
bool RideTypeDescriptor::SupportsTrackPiece(const uint64_t trackPiece) const
{
return GetAvailableTrackPieces() & (1ULL << trackPiece);
}