mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 15:24:30 +01:00
Replace hardcoded occurrences of RIDE_ENTRY_INDEX_NULL
This commit is contained in:
@@ -77,7 +77,7 @@ int32_t viewport_interaction_get_item_left(int32_t x, int32_t y, viewport_intera
|
||||
{
|
||||
case SPRITE_IDENTIFIER_VEHICLE:
|
||||
vehicle = &(sprite->vehicle);
|
||||
if (vehicle->ride_subtype != 255)
|
||||
if (vehicle->ride_subtype != RIDE_ENTRY_INDEX_NULL)
|
||||
vehicle_set_map_toolbar(vehicle);
|
||||
else
|
||||
info->type = VIEWPORT_INTERACTION_ITEM_NONE;
|
||||
|
||||
@@ -447,7 +447,7 @@ static void window_new_ride_scroll_to_focused_ride(rct_window* w)
|
||||
int32_t focusRideType = _windowNewRideHighlightedItem[_windowNewRideCurrentTab].ride_type_and_entry;
|
||||
int32_t count = 0, row = 0;
|
||||
ride_list_item* listItem = _windowNewRideListItems;
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != 255)
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != RIDE_ENTRY_INDEX_NULL)
|
||||
{
|
||||
if (listItem->type == focusRideType)
|
||||
{
|
||||
@@ -751,7 +751,7 @@ static void window_new_ride_scrollgetsize(rct_window* w, int32_t scrollIndex, in
|
||||
ride_list_item* listItem = _windowNewRideListItems;
|
||||
|
||||
int32_t count = 0;
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != 255)
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != RIDE_ENTRY_INDEX_NULL)
|
||||
{
|
||||
count++;
|
||||
listItem++;
|
||||
@@ -768,7 +768,7 @@ static void window_new_ride_scrollmousedown(rct_window* w, int32_t scrollIndex,
|
||||
ride_list_item item;
|
||||
|
||||
item = window_new_ride_scroll_get_ride_list_item_at(w, x, y);
|
||||
if (item.type == RIDE_TYPE_NULL && item.entry_index == 255)
|
||||
if (item.type == RIDE_TYPE_NULL && item.entry_index == RIDE_ENTRY_INDEX_NULL)
|
||||
return;
|
||||
|
||||
_windowNewRideHighlightedItem[_windowNewRideCurrentTab] = item;
|
||||
@@ -839,7 +839,7 @@ static void window_new_ride_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
ride_list_item item;
|
||||
item.ride_type_and_entry = static_cast<uint16_t>(w->new_ride.highlighted_ride_id);
|
||||
if (item.type != RIDE_TYPE_NULL || item.entry_index != 255)
|
||||
if (item.type != RIDE_TYPE_NULL || item.entry_index != RIDE_ENTRY_INDEX_NULL)
|
||||
window_new_ride_paint_ride_information(w, dpi, item, w->x + 3, w->y + w->height - 64, w->width - 6);
|
||||
}
|
||||
else
|
||||
@@ -862,7 +862,7 @@ static void window_new_ride_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
||||
int32_t x = 1;
|
||||
int32_t y = 1;
|
||||
ride_list_item* listItem = _windowNewRideListItems;
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != 255)
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != RIDE_ENTRY_INDEX_NULL)
|
||||
{
|
||||
rct_ride_entry* rideEntry;
|
||||
// Draw flat button rectangle
|
||||
@@ -920,7 +920,7 @@ static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window* w
|
||||
int32_t index = column + (row * 5);
|
||||
|
||||
ride_list_item* listItem = _windowNewRideListItems;
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != 255)
|
||||
while (listItem->type != RIDE_TYPE_NULL || listItem->entry_index != RIDE_ENTRY_INDEX_NULL)
|
||||
{
|
||||
if (index-- == 0)
|
||||
return *listItem;
|
||||
|
||||
@@ -610,7 +610,7 @@ private:
|
||||
void AddEntryForRideType(uint8_t rideType)
|
||||
{
|
||||
assert(rideType < std::size(_rideTypeToRideEntryMap));
|
||||
if (_rideTypeToRideEntryMap[rideType] == 255)
|
||||
if (_rideTypeToRideEntryMap[rideType] == RIDE_ENTRY_INDEX_NULL)
|
||||
{
|
||||
const char* entryName = RCT1::GetRideTypeObject(rideType);
|
||||
if (!String::Equals(entryName, " "))
|
||||
@@ -624,7 +624,7 @@ private:
|
||||
void AddEntryForVehicleType(uint8_t rideType, uint8_t vehicleType)
|
||||
{
|
||||
assert(vehicleType < std::size(_vehicleTypeToRideEntryMap));
|
||||
if (_vehicleTypeToRideEntryMap[vehicleType] == 255)
|
||||
if (_vehicleTypeToRideEntryMap[vehicleType] == RIDE_ENTRY_INDEX_NULL)
|
||||
{
|
||||
const char* entryName = RCT1::GetVehicleObject(vehicleType);
|
||||
if (!String::Equals(entryName, " "))
|
||||
@@ -2521,7 +2521,7 @@ private:
|
||||
{
|
||||
uint8_t entryIndex = _rideTypeToRideEntryMap[srcItem];
|
||||
|
||||
if (entryIndex != 255)
|
||||
if (entryIndex != RIDE_ENTRY_INDEX_NULL)
|
||||
{
|
||||
rct_ride_entry* rideEntry = get_ride_entry(entryIndex);
|
||||
|
||||
@@ -2539,7 +2539,7 @@ private:
|
||||
{
|
||||
uint8_t entryIndex = _vehicleTypeToRideEntryMap[srcItem];
|
||||
|
||||
if (entryIndex != 255)
|
||||
if (entryIndex != RIDE_ENTRY_INDEX_NULL)
|
||||
{
|
||||
rct_ride_entry* rideEntry = get_ride_entry(entryIndex);
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ uint8_t* get_ride_entry_indices_for_ride_type(uint8_t rideType)
|
||||
do
|
||||
{
|
||||
entryIndexList++;
|
||||
} while (*(entryIndexList - 1) != 255);
|
||||
} while (*(entryIndexList - 1) != RIDE_ENTRY_INDEX_NULL);
|
||||
rideType--;
|
||||
}
|
||||
return entryIndexList;
|
||||
@@ -5751,7 +5751,7 @@ int32_t ride_is_valid_for_test(ride_id_t rideIndex, int32_t goingToBeOpen, int32
|
||||
}
|
||||
}
|
||||
|
||||
if (ride->subtype != 255)
|
||||
if (ride->subtype != RIDE_ENTRY_INDEX_NULL)
|
||||
{
|
||||
rct_ride_entry* rideType = get_ride_entry(ride->subtype);
|
||||
if (rideType->flags & RIDE_ENTRY_FLAG_NO_INVERSIONS)
|
||||
@@ -5889,7 +5889,7 @@ int32_t ride_is_valid_for_open(ride_id_t rideIndex, int32_t goingToBeOpen, int32
|
||||
}
|
||||
}
|
||||
|
||||
if (ride->subtype != 255)
|
||||
if (ride->subtype != RIDE_ENTRY_INDEX_NULL)
|
||||
{
|
||||
rct_ride_entry* rideType = get_ride_entry(ride->subtype);
|
||||
if (rideType->flags & RIDE_ENTRY_FLAG_NO_INVERSIONS)
|
||||
|
||||
Reference in New Issue
Block a user