Rename INVALID_DIRECTION to kInvalidDirection

This commit is contained in:
Gymnasiast committed 2025-03-25 22:47:08 +01:00
1 parent d0368a7f02
commit fa15bc56d2
20 files changed
+67 -67

No files matched your search

+3 -3
View File
@@ -365,7 +365,7 @@ namespace OpenRCT2
CoordsXYZD RideGetEntranceOrExitPositionFromScreenPosition(const ScreenCoordsXY& screenCoords)
{
CoordsXYZD entranceExitCoords{};
gRideEntranceExitPlaceDirection = INVALID_DIRECTION;
gRideEntranceExitPlaceDirection = kInvalidDirection;
// determine if the mouse is hovering over a station - that's the station to add the entrance to
auto info = GetMapCoordinatesFromPos(screenCoords, EnumsToFlags(ViewportInteractionItem::Ride));
if (info.interactionType != ViewportInteractionItem::None)
@@ -407,7 +407,7 @@ namespace OpenRCT2
return entranceExitCoords;
}
entranceExitCoords = { coordsAtHeight->ToTileStart(), stationBaseZ, INVALID_DIRECTION };
entranceExitCoords = { coordsAtHeight->ToTileStart(), stationBaseZ, kInvalidDirection };
if (ride->type == kRideTypeNull)
{
@@ -482,7 +482,7 @@ namespace OpenRCT2
} while (!(tileElement++)->IsLastForTile());
}
}
gRideEntranceExitPlaceDirection = INVALID_DIRECTION;
gRideEntranceExitPlaceDirection = kInvalidDirection;
return entranceExitCoords;
}
@@ -129,9 +129,9 @@ namespace OpenRCT2::Ui::Windows
CoordsXYZD PlaceParkEntranceGetMapPosition(const ScreenCoordsXY& screenCoords)
{
CoordsXYZD parkEntranceMapPosition{ 0, 0, 0, INVALID_DIRECTION };
CoordsXYZD parkEntranceMapPosition{ 0, 0, 0, kInvalidDirection };
const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords);
parkEntranceMapPosition = { mapCoords.x, mapCoords.y, 0, INVALID_DIRECTION };
parkEntranceMapPosition = { mapCoords.x, mapCoords.y, 0, kInvalidDirection };
if (parkEntranceMapPosition.IsNull())
return parkEntranceMapPosition;
+6 -6
View File
@@ -1145,7 +1145,7 @@ namespace OpenRCT2::Ui::Windows
PathConstructFlags constructFlags = FootpathCreateConstructFlags(selectedType);
auto footpathPlaceAction = FootpathPlaceAction(
{ *mapPos, baseZ }, slope, selectedType, gFootpathSelection.Railings, INVALID_DIRECTION, constructFlags);
{ *mapPos, baseZ }, slope, selectedType, gFootpathSelection.Railings, kInvalidDirection, constructFlags);
footpathPlaceAction.SetCallback([this](const GameAction* ga, const GameActions::Result* result) {
if (result->Error == GameActions::Status::Ok)
{
@@ -1216,7 +1216,7 @@ namespace OpenRCT2::Ui::Windows
_provisionalFootpath.flags.clearAll();
gFootpathConstructSlope = 0;
_footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL;
_footpathConstructValidDirections = INVALID_DIRECTION;
_footpathConstructValidDirections = kInvalidDirection;
WindowFootpathSetEnabledAndPressedWidgets();
}
@@ -1256,7 +1256,7 @@ namespace OpenRCT2::Ui::Windows
{
if (gFootpathConstructSlope == 0)
{
self->_footpathConstructValidDirections = INVALID_DIRECTION;
self->_footpathConstructValidDirections = kInvalidDirection;
}
else
{
@@ -1328,7 +1328,7 @@ namespace OpenRCT2::Ui::Windows
gFootpathConstructFromPosition.y -= CoordsDirectionDelta[edge].y;
gFootpathConstructFromPosition.z = z;
_footpathConstructDirection = edge;
_footpathConstructValidDirections = INVALID_DIRECTION;
_footpathConstructValidDirections = kInvalidDirection;
}
/**
@@ -1452,7 +1452,7 @@ namespace OpenRCT2::Ui::Windows
// Enable / disable directional widgets
direction = _footpathConstructValidDirections;
if (direction != INVALID_DIRECTION)
if (direction != kInvalidDirection)
{
disabledWidgets |= (1uLL << WIDX_DIRECTION_NW) | (1uLL << WIDX_DIRECTION_NE) | (1uLL << WIDX_DIRECTION_SW)
| (1uLL << WIDX_DIRECTION_SE);
@@ -1760,7 +1760,7 @@ namespace OpenRCT2::Ui::Windows
FootpathRemoveProvisional();
auto footpathPlaceAction = FootpathPlaceAction(
footpathLoc, slope, type, railingsType, INVALID_DIRECTION, constructFlags);
footpathLoc, slope, type, railingsType, kInvalidDirection, constructFlags);
footpathPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED);
auto res = GameActions::Execute(&footpathPlaceAction);
cost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined;
+1 -1
View File
@@ -352,7 +352,7 @@ namespace OpenRCT2::Ui::Windows
if (entranceOrExitCoords.IsNull())
return;
if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION)
if (gRideEntranceExitPlaceDirection == kInvalidDirection)
return;
RideId rideIndex = gRideEntranceExitPlaceRideIndex;
+2 -2
View File
@@ -2593,7 +2593,7 @@ namespace OpenRCT2::Ui::Windows
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
CoordsXYZD entranceOrExitCoords = RideGetEntranceOrExitPositionFromScreenPosition(screenCoords);
if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION)
if (gRideEntranceExitPlaceDirection == kInvalidDirection)
return;
auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction(
@@ -3509,7 +3509,7 @@ namespace OpenRCT2::Ui::Windows
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
CoordsXYZD entranceOrExitCoords = RideGetEntranceOrExitPositionFromScreenPosition(screenCoords);
if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION)
if (gRideEntranceExitPlaceDirection == kInvalidDirection)
{
RideConstructionInvalidateCurrentTrack();
return;
+2 -2
View File
@@ -106,7 +106,7 @@ GameActions::Result FootpathPlaceAction::Query() const
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_TOO_HIGH);
}
if (_direction != INVALID_DIRECTION && !DirectionValid(_direction))
if (_direction != kInvalidDirection && !DirectionValid(_direction))
{
LOG_ERROR("Direction invalid. direction = %u", _direction);
return GameActions::Result(
@@ -143,7 +143,7 @@ GameActions::Result FootpathPlaceAction::Execute() const
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
{
if (_direction != INVALID_DIRECTION && !getGameState().cheats.disableClearanceChecks)
if (_direction != kInvalidDirection && !getGameState().cheats.disableClearanceChecks)
{
// It is possible, let's remove walls between the old and new piece of path
auto zLow = _loc.z;
+2 -2
View File
@@ -19,14 +19,14 @@ private:
uint8_t _slope{};
ObjectEntryIndex _type{};
ObjectEntryIndex _railingsType{};
Direction _direction{ INVALID_DIRECTION };
Direction _direction{ kInvalidDirection };
PathConstructFlags _constructFlags{};
public:
FootpathPlaceAction() = default;
FootpathPlaceAction(
const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, ObjectEntryIndex railingsType,
Direction direction = INVALID_DIRECTION, PathConstructFlags constructFlags = 0);
Direction direction = kInvalidDirection, PathConstructFlags constructFlags = 0);
void AcceptParameters(GameActionParameterVisitor& visitor) override;
uint16_t GetActionFlags() const override;
@@ -16,7 +16,7 @@ class RideEntranceExitPlaceAction final : public GameActionBase<GameCommand::Pla
{
private:
CoordsXY _loc;
Direction _direction{ INVALID_DIRECTION };
Direction _direction{ kInvalidDirection };
RideId _rideIndex{ RideId::GetNull() };
StationIndex _stationNum{ StationIndex::GetNull() };
bool _isExit{};
+1 -1
View File
@@ -186,7 +186,7 @@ GameActions::Result StaffHireNewAction::QueryExecute(bool execute) const
newPeep->PathfindGoal.x = 0xFF;
newPeep->PathfindGoal.y = 0xFF;
newPeep->PathfindGoal.z = 0xFF;
newPeep->PathfindGoal.direction = INVALID_DIRECTION;
newPeep->PathfindGoal.direction = kInvalidDirection;
uint8_t colour = StaffGetColour(static_cast<StaffType>(_staffType));
newPeep->TshirtColour = colour;
+1 -1
View File
@@ -28,7 +28,7 @@ class WallPlaceAction final : public GameActionBase<GameCommand::PlaceWall>
private:
ObjectEntryIndex _wallType{ kObjectEntryIndexNull };
CoordsXYZ _loc;
Direction _edge{ INVALID_DIRECTION };
Direction _edge{ kInvalidDirection };
int32_t _primaryColour{ COLOUR_BLACK };
int32_t _secondaryColour{ COLOUR_BLACK };
int32_t _tertiaryColour{ COLOUR_BLACK };
+1 -1
View File
@@ -4713,7 +4713,7 @@ void Guest::UpdateRideApproachSpiralSlide()
auto exit = ride->getStation(CurrentRideStation).Exit;
waypoint = 1;
auto directionTemp = exit.direction;
if (exit.direction == INVALID_DIRECTION)
if (exit.direction == kInvalidDirection)
{
directionTemp = 0;
}
+1 -1
View File
@@ -2988,5 +2988,5 @@ void Peep::Paint(PaintSession& session, int32_t imageDirection) const
void Peep::ResetPathfindGoal()
{
PathfindGoal.SetNull();
PathfindGoal.direction = INVALID_DIRECTION;
PathfindGoal.direction = kInvalidDirection;
}
+20 -20
View File
@@ -319,7 +319,7 @@ bool Staff::HasPatrolArea() const
*
* rct2: 0x006BFBE8
*
* Returns INVALID_DIRECTION when no nearby litter or unpathable litter
* Returns kInvalidDirection when no nearby litter or unpathable litter
*/
Direction Staff::HandymanDirectionToNearestLitter() const
{
@@ -338,14 +338,14 @@ Direction Staff::HandymanDirectionToNearestLitter() const
if (nearestLitterDist > MAX_LITTER_DISTANCE)
{
return INVALID_DIRECTION;
return kInvalidDirection;
}
auto litterTile = CoordsXY{ nearestLitter->x, nearestLitter->y }.ToTileStart();
if (!IsLocationInPatrol(litterTile))
{
return INVALID_DIRECTION;
return kInvalidDirection;
}
Direction nextDirection = DirectionFromTo(CoordsXY(x, y), litterTile.ToTileCentre());
@@ -356,14 +356,14 @@ Direction Staff::HandymanDirectionToNearestLitter() const
TileElement* tileElement = MapGetFirstElementAt(nextTile);
if (tileElement == nullptr)
return INVALID_DIRECTION;
return kInvalidDirection;
do
{
if (tileElement->BaseHeight != nextZ)
continue;
if (tileElement->GetType() == TileElementType::Entrance || tileElement->GetType() == TileElementType::Track)
{
return INVALID_DIRECTION;
return kInvalidDirection;
}
} while (!(tileElement++)->IsLastForTile());
@@ -371,7 +371,7 @@ Direction Staff::HandymanDirectionToNearestLitter() const
tileElement = MapGetFirstElementAt(nextTile);
if (tileElement == nullptr)
return INVALID_DIRECTION;
return kInvalidDirection;
do
{
@@ -379,7 +379,7 @@ Direction Staff::HandymanDirectionToNearestLitter() const
continue;
if (tileElement->GetType() == TileElementType::Entrance || tileElement->GetType() == TileElementType::Track)
{
return INVALID_DIRECTION;
return kInvalidDirection;
}
} while (!(tileElement++)->IsLastForTile());
@@ -396,18 +396,18 @@ uint8_t Staff::HandymanDirectionToUncutGrass(uint8_t valid_directions) const
{
auto surfaceElement = MapGetSurfaceElementAt(NextLoc);
if (surfaceElement == nullptr)
return INVALID_DIRECTION;
return kInvalidDirection;
if (NextLoc.z != surfaceElement->GetBaseZ())
return INVALID_DIRECTION;
return kInvalidDirection;
if (GetNextIsSloped())
{
if (surfaceElement->GetSlope() != kPathSlopeToLandSlope[GetNextDirection()])
return INVALID_DIRECTION;
return kInvalidDirection;
}
else if (surfaceElement->GetSlope() != kTileSlopeFlat)
return INVALID_DIRECTION;
return kInvalidDirection;
}
uint8_t chosenDirection = ScenarioRand() & 0x3;
@@ -437,7 +437,7 @@ uint8_t Staff::HandymanDirectionToUncutGrass(uint8_t valid_directions) const
}
}
}
return INVALID_DIRECTION;
return kInvalidDirection;
}
/**
@@ -475,7 +475,7 @@ bool Staff::DoHandymanPathFinding()
{
StaffMowingTimeout++;
Direction litterDirection = INVALID_DIRECTION;
Direction litterDirection = kInvalidDirection;
uint8_t validDirections = GetValidPatrolDirections(NextLoc);
if ((StaffOrders & STAFF_ORDERS_SWEEPING) && ((getGameState().currentTicks + Id.ToUnderlying()) & 0xFFF) > 110)
@@ -483,13 +483,13 @@ bool Staff::DoHandymanPathFinding()
litterDirection = HandymanDirectionToNearestLitter();
}
Direction newDirection = INVALID_DIRECTION;
if (litterDirection == INVALID_DIRECTION && (StaffOrders & STAFF_ORDERS_MOWING) && StaffMowingTimeout >= 12)
Direction newDirection = kInvalidDirection;
if (litterDirection == kInvalidDirection && (StaffOrders & STAFF_ORDERS_MOWING) && StaffMowingTimeout >= 12)
{
newDirection = HandymanDirectionToUncutGrass(validDirections);
}
if (newDirection == INVALID_DIRECTION)
if (newDirection == kInvalidDirection)
{
if (GetNextIsSurface())
{
@@ -510,7 +510,7 @@ bool Staff::DoHandymanPathFinding()
else
{
bool chooseRandom = true;
if (litterDirection != INVALID_DIRECTION && pathDirections & (1 << litterDirection))
if (litterDirection != kInvalidDirection && pathDirections & (1 << litterDirection))
{
/// Check whether path is a queue path and connected to a ride
bool connectedQueue = (pathElement->IsQueue() && !pathElement->GetRideIndex().IsNull());
@@ -708,7 +708,7 @@ Direction Staff::MechanicDirectionPath(uint8_t validDirections, PathElement* pat
const auto goalPos = TileCoordsXYZ{ location };
Direction pathfindDirection = PathFinding::ChooseDirection(
TileCoordsXYZ{ NextLoc }, goalPos, *this, false, RideId::GetNull());
if (pathfindDirection == INVALID_DIRECTION)
if (pathfindDirection == kInvalidDirection)
{
/* Heuristic search failed for all directions.
* Reset the PathfindGoal - this means that the PathfindHistory
@@ -732,7 +732,7 @@ Direction Staff::MechanicDirectionPath(uint8_t validDirections, PathElement* pat
bool Staff::DoMechanicPathFinding()
{
uint8_t validDirections = GetValidPatrolDirections(NextLoc);
Direction newDirection = INVALID_DIRECTION;
Direction newDirection = kInvalidDirection;
if (GetNextIsSurface())
{
newDirection = MechanicDirectionSurface();
@@ -813,7 +813,7 @@ bool Staff::DoMiscPathFinding()
{
uint8_t validDirections = GetValidPatrolDirections(NextLoc);
Direction newDirection = INVALID_DIRECTION;
Direction newDirection = kInvalidDirection;
if (GetNextIsSurface())
{
newDirection = DirectionSurface(ScenarioRand() & 3);
+8 -8
View File
@@ -1297,7 +1297,7 @@ namespace OpenRCT2::PathFinding
} while (!(destTileElement++)->IsLastForTile());
// Peep is not on a path.
if (!found)
return INVALID_DIRECTION;
return kInvalidDirection;
permittedEdges &= 0xF;
uint32_t edges = permittedEdges;
@@ -1373,7 +1373,7 @@ namespace OpenRCT2::PathFinding
// Peep has tried all edges.
if (edges == 0)
return INVALID_DIRECTION;
return kInvalidDirection;
int32_t chosenEdge = Numerics::bitScanForward(edges);
@@ -1417,7 +1417,7 @@ namespace OpenRCT2::PathFinding
for (auto& entry : state.history)
{
entry.location.SetNull();
entry.direction = INVALID_DIRECTION;
entry.direction = kInvalidDirection;
}
/* The pathfinding will only use elements
@@ -1506,7 +1506,7 @@ namespace OpenRCT2::PathFinding
if (bestScore == 0xFFFF)
{
LogPathfinding(&peep, "Pathfind heuristic search failed.");
return INVALID_DIRECTION;
return kInvalidDirection;
}
if constexpr (kLogPathfinding)
@@ -1600,7 +1600,7 @@ namespace OpenRCT2::PathFinding
const auto goalPos = TileCoordsXYZ(chosenEntrance.value());
Direction chosenDirection = ChooseDirection(TileCoordsXYZ{ peep.NextLoc }, goalPos, peep, true, RideId::GetNull());
if (chosenDirection == INVALID_DIRECTION)
if (chosenDirection == kInvalidDirection)
return GuestPathfindAimless(peep, edges);
return PeepMoveOneTile(chosenDirection, peep);
@@ -1653,7 +1653,7 @@ namespace OpenRCT2::PathFinding
const auto goalPos = TileCoordsXYZ(peepSpawnLoc);
direction = ChooseDirection(TileCoordsXYZ{ peep.NextLoc }, goalPos, peep, true, RideId::GetNull());
if (direction == INVALID_DIRECTION)
if (direction == kInvalidDirection)
return GuestPathfindAimless(peep, edges);
return PeepMoveOneTile(direction, peep);
@@ -1689,7 +1689,7 @@ namespace OpenRCT2::PathFinding
}
Direction chosenDirection = ChooseDirection(TileCoordsXYZ{ peep.NextLoc }, entranceGoal, peep, true, RideId::GetNull());
if (chosenDirection == INVALID_DIRECTION)
if (chosenDirection == kInvalidDirection)
return GuestPathfindAimless(peep, edges);
return PeepMoveOneTile(chosenDirection, peep);
@@ -2107,7 +2107,7 @@ namespace OpenRCT2::PathFinding
direction = ChooseDirection(TileCoordsXYZ{ peep.NextLoc }, loc, peep, true, rideIndex);
if (direction == INVALID_DIRECTION)
if (direction == kInvalidDirection)
{
/* Heuristic search failed for all directions.
* Reset the PathfindGoal - this means that the PathfindHistory
+1 -1
View File
@@ -1401,7 +1401,7 @@ namespace OpenRCT2::RCT1
dst->PathfindGoal.x = 0xFF;
dst->PathfindGoal.y = 0xFF;
dst->PathfindGoal.z = 0xFF;
dst->PathfindGoal.direction = INVALID_DIRECTION;
dst->PathfindGoal.direction = kInvalidDirection;
}
void ImportStaffPatrolArea(Staff* staffmember, uint8_t staffId)
+4 -4
View File
@@ -170,12 +170,12 @@ static Direction GetDirection(const json_t& parameters)
{
if (!parameters.contains(_directionKey))
{
return INVALID_DIRECTION;
return kInvalidDirection;
}
else if (!parameters[_directionKey].is_number())
{
OpenRCT2::Guard::Assert(0, "Fix direction must be a number");
return INVALID_DIRECTION;
return kInvalidDirection;
}
Direction direction = OpenRCT2::Json::GetNumber<Direction>(parameters[_directionKey]);
@@ -183,7 +183,7 @@ static Direction GetDirection(const json_t& parameters)
if (direction > 3)
{
OpenRCT2::Guard::Assert(0, "Direction must be between 0 and 3");
return INVALID_DIRECTION;
return kInvalidDirection;
}
return direction;
@@ -654,7 +654,7 @@ static void ApplyPathFixes(const json_t& scenarioPatch)
for (auto coordinate : coordinates)
{
auto slope = direction != INVALID_DIRECTION ? direction + 4 : 0;
auto slope = direction != kInvalidDirection ? direction + 4 : 0;
auto footpathPlaceAction = FootpathPlaceAction(
coordinate.ToCoordsXYZ(), slope, surfaceObjIndex, railingsObjIndex, direction, constructionFlags);
auto result = footpathPlaceAction.Execute();
+3 -3
View File
@@ -1651,7 +1651,7 @@ namespace OpenRCT2::RCT2
void ImportEntityPeep(::Peep* dst, const Peep* src)
{
const auto isNullLocation = [](const RCT12xyzd8& pos) {
return pos.x == 0xFF && pos.y == 0xFF && pos.z == 0xFF && pos.direction == INVALID_DIRECTION;
return pos.x == 0xFF && pos.y == 0xFF && pos.z == 0xFF && pos.direction == kInvalidDirection;
};
ImportEntityCommonProperties(static_cast<EntityBase*>(dst), src);
@@ -1697,7 +1697,7 @@ namespace OpenRCT2::RCT2
if (isNullLocation(src->PathfindGoal))
{
dst->PathfindGoal.SetNull();
dst->PathfindGoal.direction = INVALID_DIRECTION;
dst->PathfindGoal.direction = kInvalidDirection;
}
else
{
@@ -1709,7 +1709,7 @@ namespace OpenRCT2::RCT2
if (isNullLocation(src->PathfindHistory[i]))
{
dst->PathfindHistory[i].SetNull();
dst->PathfindHistory[i].direction = INVALID_DIRECTION;
dst->PathfindHistory[i].direction = kInvalidDirection;
}
else
{
+5 -5
View File
@@ -253,7 +253,7 @@ void Ride::removePeeps()
auto stationIndex = RideGetFirstValidStationStart(*this);
// Get exit position and direction
auto exitPosition = CoordsXYZD{ 0, 0, 0, INVALID_DIRECTION };
auto exitPosition = CoordsXYZD{ 0, 0, 0, kInvalidDirection };
if (!stationIndex.IsNull())
{
auto location = getStation(stationIndex).Exit.ToCoordsXYZD();
@@ -285,7 +285,7 @@ void Ride::removePeeps()
if (peep->State == PeepState::QueuingFront && peep->RideSubState == PeepRideSubState::AtEntrance)
peep->RemoveFromQueue();
if (exitPosition.direction == INVALID_DIRECTION)
if (exitPosition.direction == kInvalidDirection)
{
CoordsXYZ newLoc = { peep->NextLoc.ToTileCentre(), peep->NextLoc.z };
if (peep->GetNextIsSloped())
@@ -315,7 +315,7 @@ void Ride::removePeeps()
if (peep->CurrentRide != id)
continue;
if (exitPosition.direction == INVALID_DIRECTION)
if (exitPosition.direction == kInvalidDirection)
{
CoordsXYZ newLoc = { peep->NextLoc.ToTileCentre(), peep->NextLoc.z };
if (peep->GetNextIsSloped())
@@ -1185,14 +1185,14 @@ void Ride::validateStations()
continue;
CoordsXYZ location = station.GetStart();
uint8_t direction = INVALID_DIRECTION;
uint8_t direction = kInvalidDirection;
bool specialTrack = false;
TileElement* tileElement = nullptr;
while (true)
{
// search backwards for the previous station TrackElement (only if the first station TrackElement is found)
if (direction != INVALID_DIRECTION)
if (direction != kInvalidDirection)
{
location.x -= CoordsDirectionDelta[direction].x;
location.y -= CoordsDirectionDelta[direction].y;
+2 -2
View File
@@ -536,7 +536,7 @@ struct TileCoordsXYRangedZ : public TileCoordsXY
*/
using Direction = uint8_t;
const Direction INVALID_DIRECTION = 0xFF;
const Direction kInvalidDirection = 0xFF;
/**
* Array of all valid cardinal directions, to make it easy to write range-based for loops like:
@@ -736,7 +736,7 @@ struct TileCoordsXYZD : public TileCoordsXYZ
constexpr void SetNull()
{
TileCoordsXYZ::SetNull();
direction = INVALID_DIRECTION;
direction = kInvalidDirection;
}
};
+1 -1
View File
@@ -88,7 +88,7 @@ protected:
// Pick the direction the peep should initially move in, given the goal position.
// This will also store the goal position and initialize pathfinding data for the peep.
const Direction moveDir = PathFinding::ChooseDirection(*pos, goal, *peep, false, RideId::GetNull());
if (moveDir == INVALID_DIRECTION)
if (moveDir == kInvalidDirection)
{
// Couldn't determine a direction to move off in
return false;