]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/track.cpp
Things with different gauges don't go together
[r2c2.git] / source / libr2c2 / track.cpp
index 7b6bef1de2d7e914846f67ec1b8c5f8b4eadfd64..f1fdd992822180c26ddd5c39a6095bb8145516e4 100644 (file)
@@ -320,6 +320,10 @@ bool Track::link_to(Object &other)
        if(!otrack)
                return false;
 
+       float gauge_ratio = otrack->get_type().get_gauge()/type.get_gauge();
+       if(gauge_ratio<0.99 || gauge_ratio>1.01)
+               return false;
+
        float limit = type.get_gauge();
        if(!flex && !otrack->get_flex())
                limit /= 10;