1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Only log path finding when PEEP_FLAGS_DEBUG_PATHFINDING is active

This commit is contained in:
ζeh Matt
2024-02-22 23:07:48 +02:00
parent 523bd0ae36
commit 3f456b7b2b

View File

@@ -64,13 +64,17 @@ namespace OpenRCT2::PathFinding
};
#pragma region Pathfinding Logging
// In case this is set to true it will enable code paths that log path finding.
// In case this is set to true it will enable code paths that log path finding. The peep will additionally
// require to have PEEP_FLAGS_DEBUG_PATHFINDING set in PeepFlags in order to activate logging.
static constexpr bool kLogPathfinding = false;
template<typename... TArgs> static void LogPathfinding(const Peep* peep, const char* format, TArgs&&... args)
{
if constexpr (kLogPathfinding)
{
if ((peep->PeepFlags & PEEP_FLAGS_DEBUG_PATHFINDING) == 0)
return;
char buffer[256];
snprintf(buffer, sizeof(buffer), format, std::forward<TArgs>(args)...);