Don't try to paint debug info if debugging is disabled

This commit is contained in:
Manuel Vögele
2022-01-30 00:01:40 +01:00
parent efc3eb871c
commit 43c05745c8
+3 -2
View File
@@ -130,9 +130,10 @@ function estimateCost(pos, target) {
}
function paintPathfindingDebug(lastNode) {
if (CONFIG.debug.dragRuler) {
if (!CONFIG.debug.dragRuler)
return;
debugGraphics.removeChildren();
}
let currentNode = lastNode;
while (currentNode) {
let text = new PIXI.Text(currentNode.cost.toFixed(0));