Small optimisation to station highlighting
authorNick Gasson <nick@nickg.me.uk>
Sun, 7 Jun 2009 13:38:23 +0000 (14:38 +0100)
committerNick Gasson <nick@nickg.me.uk>
Sun, 7 Jun 2009 13:38:23 +0000 (14:38 +0100)
src/Game.cpp

index feee3e2609691b0d77eb3884287d017e5d65ba0a..58da2bf44a33327a7818bc8e1fadeb04f86f3e38 100644 (file)
@@ -178,9 +178,11 @@ void Game::update(IPickBufferPtr aPickBuffer, int aDelta)
 void Game::nearStation(IStationPtr aStation)
 {
    leftStation();  // Clear any previous station
-   
-   myActiveStation = aStation;
-   aStation->setHighlightVisible(true);
+
+   if (aStation != myActiveStation) {
+      myActiveStation = aStation;
+      aStation->setHighlightVisible(true);
+   }
 }
 
 // Signal that we are no longer at or approaching a station