diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2015-04-10 01:56:37 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2015-04-10 01:56:37 +0200 |
commit | 47b608249297db033e4ae9e2333b7a7b72abb63e (patch) | |
tree | e557b7fa14dc2014a074a1b1e94041811056eeb5 | |
parent | 61e76e9cca6d02b109bbc2c414e87a23a39ed81b (diff) |
NMS2: Only redraw switches if color actually changed
-rw-r--r-- | web/nms.gathering.org/nms2/map.js | 6 |
1 files changed, 4 insertions, 2 deletions
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); + } } /* |