1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 00:34:46 +01:00

Use RideId::GetNull and RideId::IsNull over constant

This commit is contained in:
ζeh Matt
2022-01-19 18:24:23 +02:00
parent 4554d6d883
commit 06e430157f
41 changed files with 102 additions and 104 deletions

View File

@@ -294,7 +294,7 @@ static uint8_t footpath_element_next_in_direction(TileCoordsXYZ loc, PathElement
if (nextTileElement->AsPath()->IsWide())
return PATH_SEARCH_WIDE;
// Only queue tiles that are connected to a ride are returned as ride queues.
if (nextTileElement->AsPath()->IsQueue() && nextTileElement->AsPath()->GetRideIndex() != RIDE_ID_NULL)
if (nextTileElement->AsPath()->IsQueue() && !nextTileElement->AsPath()->GetRideIndex().IsNull())
return PATH_SEARCH_RIDE_QUEUE;
return PATH_SEARCH_OTHER;
@@ -756,7 +756,7 @@ static void peep_pathfind_heuristic_search(
if (tileElement->IsGhost())
continue;
RideId rideIndex = RIDE_ID_NULL;
RideId rideIndex = RideId::GetNull();
switch (tileElement->GetType())
{
case TileElementType::Track:
@@ -859,7 +859,7 @@ static void peep_pathfind_heuristic_search(
if (tileElement->AsPath()->IsQueue()
&& tileElement->AsPath()->GetRideIndex() != gPeepPathFindQueueRideIndex)
{
if (gPeepPathFindIgnoreForeignQueues && (tileElement->AsPath()->GetRideIndex() != RIDE_ID_NULL))
if (gPeepPathFindIgnoreForeignQueues && !tileElement->AsPath()->GetRideIndex().IsNull())
{
// Path is a queue we aren't interested in
/* The rideIndex will be useful for
@@ -1673,7 +1673,7 @@ static int32_t GuestPathFindParkEntranceEntering(Peep* peep, uint8_t edges)
gPeepPathFindGoalPosition = TileCoordsXYZ(chosenEntrance.value());
gPeepPathFindIgnoreForeignQueues = true;
gPeepPathFindQueueRideIndex = RIDE_ID_NULL;
gPeepPathFindQueueRideIndex = RideId::GetNull();
Direction chosenDirection = peep_pathfind_choose_direction(TileCoordsXYZ{ peep->NextLoc }, peep);
@@ -1730,7 +1730,7 @@ static int32_t GuestPathFindPeepSpawn(Peep* peep, uint8_t edges)
}
gPeepPathFindIgnoreForeignQueues = true;
gPeepPathFindQueueRideIndex = RIDE_ID_NULL;
gPeepPathFindQueueRideIndex = RideId::GetNull();
direction = peep_pathfind_choose_direction(TileCoordsXYZ{ peep->NextLoc }, peep);
if (direction == INVALID_DIRECTION)
return guest_path_find_aimless(peep, edges);
@@ -1769,7 +1769,7 @@ static int32_t GuestPathFindParkEntranceLeaving(Peep* peep, uint8_t edges)
gPeepPathFindGoalPosition = entranceGoal;
gPeepPathFindIgnoreForeignQueues = true;
gPeepPathFindQueueRideIndex = RIDE_ID_NULL;
gPeepPathFindQueueRideIndex = RideId::GetNull();
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
PathfindLoggingEnable(peep);
@@ -2096,7 +2096,7 @@ int32_t guest_path_finding(Guest* peep)
if (!(adjustedEdges & (1 << chosenDirection)))
continue;
RideId rideIndex = RIDE_ID_NULL;
RideId rideIndex = RideId::GetNull();
auto pathSearchResult = footpath_element_destination_in_direction(loc, pathElement, chosenDirection, &rideIndex);
switch (pathSearchResult)
{
@@ -2143,7 +2143,7 @@ int32_t guest_path_finding(Guest* peep)
return GuestPathFindParkEntranceLeaving(peep, edges);
}
if (peep->GuestHeadingToRideId == RIDE_ID_NULL)
if (peep->GuestHeadingToRideId.IsNull())
{
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
if (_pathFindDebug)