From 43c05745c8132a8d09cd831b184074f950243957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Sun, 30 Jan 2022 00:01:40 +0100 Subject: [PATCH] Don't try to paint debug info if debugging is disabled --- src/pathfinding.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pathfinding.js b/src/pathfinding.js index 6d975d0..52afdce 100644 --- a/src/pathfinding.js +++ b/src/pathfinding.js @@ -130,9 +130,10 @@ function estimateCost(pos, target) { } function paintPathfindingDebug(lastNode) { - if (CONFIG.debug.dragRuler) { - debugGraphics.removeChildren(); - } + if (!CONFIG.debug.dragRuler) + return; + + debugGraphics.removeChildren(); let currentNode = lastNode; while (currentNode) { let text = new PIXI.Text(currentNode.cost.toFixed(0));