aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2015-04-10 01:56:37 +0200
committerKristian Lyngstol <kristian@bohemians.org>2015-04-10 01:56:37 +0200
commit47b608249297db033e4ae9e2333b7a7b72abb63e (patch)
treee557b7fa14dc2014a074a1b1e94041811056eeb5
parent61e76e9cca6d02b109bbc2c414e87a23a39ed81b (diff)
NMS2: Only redraw switches if color actually changed
-rw-r--r--web/nms.gathering.org/nms2/map.js6
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);
+ }
}
/*