]> git.tdb.fi Git - r2c2.git/commitdiff
Don't zero slope for tracks not connected on both ends
authorMikko Rasa <tdb@tdb.fi>
Sun, 19 May 2013 12:31:46 +0000 (15:31 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 19 May 2013 12:31:46 +0000 (15:31 +0300)
Since check_slope is now called implicitly when linking tracks together,
loading layouts with sloped tracks wasn't working properly.

source/libr2c2/track.cpp

index 7b5e1a2315a81f079fbec8670a1905bfae2f9838..c92ff3779021783e82ef85f9683f1fa52984d4e2 100644 (file)
@@ -106,7 +106,6 @@ void Track::check_slope()
        }
        else
        {
-               slope = 0;
                if(links[0])
                {
                        Vector epp = links[0]->get_snap_node(links[0]->get_link_slot(*this)).position;
@@ -115,7 +114,7 @@ void Track::check_slope()
                else if(links[1])
                {
                        Vector epp = links[1]->get_snap_node(links[1]->get_link_slot(*this)).position;
-                       position.z = epp.z;
+                       position.z = epp.z-slope;
                }
        }
 }