From 3f456b7b2bfbe688f00f9e36b84426776839bcec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 22 Feb 2024 23:07:48 +0200 Subject: [PATCH] Only log path finding when PEEP_FLAGS_DEBUG_PATHFINDING is active --- src/openrct2/peep/GuestPathfinding.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 159a0b6812..0dc5f88146 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -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 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(args)...);