]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/vehicle.cpp
Create a more generic version of Train::get_reserved_distance
[r2c2.git] / source / libmarklin / vehicle.cpp
index 8761bb6f9f80bfc9a906da113ac3c7ff38adf8d7..ac03de16a4ce7ed46ff87e5b04bdc40e8d79f6aa 100644 (file)
@@ -213,6 +213,8 @@ void Vehicle::check_sensor(float offset, unsigned &sensor)
        {
                /* Sensor ID under axle has changed.  Deduce movement direction by using
                the sensor ID under the midpoint of the vehicle. */
+               /* XXX This depends on the simulation running fast enough.  Something
+               more robust would be preferable. */
                unsigned old = sensor;
                sensor = s;
                unsigned mid = track_pos.track->get_sensor_id();
@@ -220,7 +222,6 @@ void Vehicle::check_sensor(float offset, unsigned &sensor)
                if(s && s!=mid)
                        /* There's a sensor and it's different from mid.  We've just entered
                        that sensor. */
-                       // XXX The Train will reset the vehicles to the start of the sensor, which is somewhat undesirable
                        layout.get_driver().set_sensor(sensor, true);
                if(old && old!=mid)
                        /* A sensor was under the axle and it was different from mid.  We've