]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/tracktype.cpp
Attempt to estimate the exact positions of trains from measured speed data
[r2c2.git] / source / libmarklin / tracktype.cpp
index 0e84a3125ced9bea789757b3e0e92bd880e53a04..2376e909484395e3ddd4b276bcbcf1df3da03a03 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of the MSP Märklin suite
-Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
+Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -56,8 +56,8 @@ void TrackType::collect_endpoints()
                bool rm=false;
                for(vector<Endpoint>::iterator j=i+1; j!=endpoints.end();)
                {
-                       float dx=i->x-j->x;
-                       float dy=i->y-j->y;
+                       float dx=i->pos.x-j->pos.x;
+                       float dy=i->pos.y-j->pos.y;
                        if(dx*dx+dy*dy<0.0001)
                        {
                                float da=i->dir-j->dir;