From 47b608249297db033e4ae9e2333b7a7b72abb63e Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Fri, 10 Apr 2015 01:56:37 +0200 Subject: NMS2: Only redraw switches if color actually changed --- web/nms.gathering.org/nms2/map.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'web/nms.gathering.org/nms2/map.js') diff --git a/web/nms.gathering.org/nms2/map.js b/web/nms.gathering.org/nms2/map.js index d7581cc..b59b0a8 100644 --- a/web/nms.gathering.org/nms2/map.js +++ b/web/nms.gathering.org/nms2/map.js @@ -744,8 +744,10 @@ function findSwitch(x,y) { */ function setSwitchColor(sw, c) { - nms.switches_now.switches[sw]['color'] = c; - drawSwitch(sw); + if(nms.switches_now.switches[sw]['color'] != c) { + nms.switches_now.switches[sw]['color'] = c; + drawSwitch(sw); + } } /* -- cgit v1.2.3