mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #21438 from ZehMatt/pathfinding-update-2
More refactoring around path finding
This commit is contained in:
commit
3beeca3fe3
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
Checks: >
|
||||
*-,
|
||||
-*,
|
||||
cppcoreguidelines-macro-usage,
|
||||
modernize-use-nullptr,
|
||||
modernize-use-override
|
||||
|
|
|
@ -2858,13 +2858,6 @@ void Peep::Paint(PaintSession& session, int32_t imageDirection) const
|
|||
*/
|
||||
void Peep::ResetPathfindGoal()
|
||||
{
|
||||
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||
if (_pathFindDebug)
|
||||
{
|
||||
LOG_INFO("Resetting PathfindGoal for %s", _pathFindDebugPeepName);
|
||||
}
|
||||
#endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||
|
||||
PathfindGoal.SetNull();
|
||||
PathfindGoal.direction = INVALID_DIRECTION;
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ enum PeepFlags : uint32_t
|
|||
{
|
||||
PEEP_FLAGS_LEAVING_PARK = (1 << 0),
|
||||
PEEP_FLAGS_SLOW_WALK = (1 << 1),
|
||||
PEEP_FLAGS_2 = (1 << 2),
|
||||
PEEP_FLAGS_DEBUG_PATHFINDING = (1 << 2), // Enables debug logging for path finding
|
||||
PEEP_FLAGS_TRACKING = (1 << 3),
|
||||
PEEP_FLAGS_WAVING = (1 << 4), // Makes the peep wave
|
||||
PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY = (1 << 5), // Set on paying to enter park
|
||||
|
|
|
@ -716,17 +716,8 @@ Direction Staff::MechanicDirectionPath(uint8_t validDirections, PathElement* pat
|
|||
gPeepPathFindIgnoreForeignQueues = false;
|
||||
gPeepPathFindQueueRideIndex = RideId::GetNull();
|
||||
|
||||
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||
PathfindLoggingEnable(*this);
|
||||
#endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||
|
||||
const auto goalPos = TileCoordsXYZ{ location };
|
||||
Direction pathfindDirection = PathFinding::ChooseDirection(TileCoordsXYZ{ NextLoc }, goalPos, *this);
|
||||
|
||||
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||
PathfindLoggingDisable();
|
||||
#endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||
|
||||
if (pathfindDirection == INVALID_DIRECTION)
|
||||
{
|
||||
/* Heuristic search failed for all directions.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -46,17 +46,4 @@ namespace OpenRCT2::PathFinding
|
|||
|
||||
bool IsValidPathZAndDirection(TileElement* tileElement, int32_t currentZ, int32_t currentDirection);
|
||||
|
||||
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||
# define PATHFIND_DEBUG \
|
||||
0 // Set to 0 to disable pathfinding debugging;
|
||||
// Set to 1 to enable pathfinding debugging.
|
||||
|
||||
// When PATHFIND_DEBUG is 1 (nonzero):
|
||||
// The following calls configure debug logging for the given peep
|
||||
// If they're a guest, pathfinding will be logged if they have PEEP_FLAGS_TRACKING set
|
||||
// If they're staff, pathfinding will be logged if their name is "Mechanic Debug"
|
||||
void PathfindLoggingEnable(Peep& peep);
|
||||
void PathfindLoggingDisable();
|
||||
#endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||
|
||||
}; // namespace OpenRCT2::PathFinding
|
||||
|
|
Loading…
Reference in New Issue