From 4fd17489a5e7d98ad2712409b6cde3c2f3feb6e3 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 24 Apr 2023 15:14:17 -0700 Subject: [PATCH] debugwaypoints: cull debug mobjs outside of drawdist --- src/k_waypoint.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/k_waypoint.cpp b/src/k_waypoint.cpp index 191a751ba..0e6919915 100644 --- a/src/k_waypoint.cpp +++ b/src/k_waypoint.cpp @@ -650,6 +650,13 @@ void K_DebugWaypointsVisualise(void) // Hunt through the waypointcap so we can show all waypoint mobjs and not just ones that were able to be graphed for (waypointmobj = waypointcap; waypointmobj != NULL; waypointmobj = waypointmobj->tracer) { + // If this waypoint is outside of draw distance, don't spawn all the debug crap because it is SLOW + if (cv_drawdist.value != 0 && + R_PointToDist(waypointmobj->x, waypointmobj->y) > cv_drawdist.value * mapobjectscale) + { + continue; + } + waypoint = K_SearchWaypointHeapForMobj(waypointmobj); debugmobj = P_SpawnMobj(waypointmobj->x, waypointmobj->y, waypointmobj->z, MT_SPARK);