]> git.tdb.fi Git - r2c2.git/commitdiff
Don't attempt to set a turnout to the already active path
authorMikko Rasa <tdb@tdb.fi>
Wed, 20 Nov 2013 12:40:04 +0000 (14:40 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 20 Nov 2013 12:40:04 +0000 (14:40 +0200)
source/libr2c2/track.cpp

index 26886344b0a1312a9bb8023c065ed6220fdcb70c..030d428f18068dd6f8b7e7d08773c1a2d7155f83 100644 (file)
@@ -193,6 +193,9 @@ void Track::set_active_path(unsigned p)
        if(!(type.get_paths()&(1<<p)))
                throw invalid_argument("Track::set_active_path");
 
+       if(active_path==p)
+               return;
+
        signal_path_changing(p);
        path_changing = true;
        layout.get_driver().set_turnout(turnout_id, p);