mirror of https://github.com/OpenRCT2/OpenRCT2.git
Refactor custom track piece handling
This commit is contained in:
parent
e2e7079f17
commit
dc04c5ec95
|
@ -2725,7 +2725,7 @@ static void window_ride_construction_update_map_selection()
|
|||
static void window_ride_construction_update_possible_ride_configurations()
|
||||
{
|
||||
int32_t trackType;
|
||||
int32_t edi;
|
||||
int32_t constructionTrackType;
|
||||
|
||||
auto ride = get_ride(_currentRideIndex);
|
||||
if (ride == nullptr)
|
||||
|
@ -2733,9 +2733,9 @@ static void window_ride_construction_update_possible_ride_configurations()
|
|||
|
||||
_currentlyShowingBrakeOrBoosterSpeed = false;
|
||||
if (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE)
|
||||
edi = RideData4[ride->type].alternate_type;
|
||||
constructionTrackType = RideData4[ride->type].alternate_type;
|
||||
else
|
||||
edi = ride->type;
|
||||
constructionTrackType = ride->type;
|
||||
|
||||
int32_t currentPossibleRideConfigurationIndex = 0;
|
||||
_numCurrentPossibleSpecialTrackPieces = 0;
|
||||
|
@ -2747,10 +2747,10 @@ static void window_ride_construction_update_possible_ride_configurations()
|
|||
if (edx == 0)
|
||||
continue;
|
||||
|
||||
if (edx & 0x80)
|
||||
if (edx & TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG)
|
||||
{
|
||||
edx &= 0x7F;
|
||||
if (edx != edi)
|
||||
edx &= ~TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG;
|
||||
if (edx != constructionTrackType)
|
||||
continue;
|
||||
}
|
||||
else if (!is_track_enabled(edx))
|
||||
|
|
|
@ -79,6 +79,7 @@ enum
|
|||
|
||||
#define MAX_STATION_PLATFORM_LENGTH 32
|
||||
constexpr uint16_t const MAX_TRACK_HEIGHT = 254;
|
||||
constexpr uint8_t const TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG = 0x80;
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -141,13 +142,13 @@ enum
|
|||
TRACK_HALF_LOOP_INVERTED,
|
||||
TRACK_BOOSTER = TRACK_ROTATION_CONTROL_TOGGLE,
|
||||
|
||||
TRACK_WATERFALL = 152,
|
||||
TRACK_WHIRLPOOL = 152,
|
||||
TRACK_BRAKE_FOR_DROP = 172,
|
||||
TRACK_190 = 190,
|
||||
TRACK_192 = 192,
|
||||
TRACK_194 = 194,
|
||||
TRACK_MINI_GOLF_HOLE = 195,
|
||||
TRACK_WATERFALL = RIDE_TYPE_RIVER_RAPIDS | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||
TRACK_WHIRLPOOL = RIDE_TYPE_RIVER_RAPIDS | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||
TRACK_BRAKE_FOR_DROP = RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||
TRACK_190 = RIDE_TYPE_LAY_DOWN_ROLLER_COASTER | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||
TRACK_192 = RIDE_TYPE_LAY_DOWN_ROLLER_COASTER_ALT | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||
TRACK_194 = RIDE_TYPE_HEARTLINE_TWISTER_COASTER | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||
TRACK_MINI_GOLF_HOLE = RIDE_TYPE_MINI_GOLF | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||
};
|
||||
|
||||
enum
|
||||
|
|
Loading…
Reference in New Issue