From 3f208bb29c37d1fd466d566e6efc7cde9c2294c5 Mon Sep 17 00:00:00 2001 From: Mashy Date: Sun, 30 Dec 2018 15:22:21 +1000 Subject: [PATCH] Remove edge search --- client/src/scenes/zones.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/client/src/scenes/zones.js b/client/src/scenes/zones.js index aafda31d..1f486dfe 100644 --- a/client/src/scenes/zones.js +++ b/client/src/scenes/zones.js @@ -87,11 +87,8 @@ class Zones extends Phaser.Scene { drawEdges(edgeData) { this.graphics.clear(); edgeData.forEach((e) => { - const drawEdge = this.nodes.filter(n => ( - e[0] === n.id || e[1] === n.id - )); - const nodeA = this.nodes[drawEdge[0].id]; - const nodeB = this.nodes[drawEdge[1].id]; + const nodeA = this.nodes[e[0]]; + const nodeB = this.nodes[e[1]]; if (nodeA.success && nodeB.success) { this.graphics.lineStyle(10, 0xfff00f, 0.2); } else {