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
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
1 changed files with 5 additions and 1 deletions

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)...);