X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fvehicle.cpp;h=ac03de16a4ce7ed46ff87e5b04bdc40e8d79f6aa;hb=3d38bcbe8add00b558012fa0cd4e0be26464dbeb;hp=8761bb6f9f80bfc9a906da113ac3c7ff38adf8d7;hpb=59e4c75da550e96ae74162a5ed70e8b1999721d8;p=r2c2.git diff --git a/source/libmarklin/vehicle.cpp b/source/libmarklin/vehicle.cpp index 8761bb6..ac03de1 100644 --- a/source/libmarklin/vehicle.cpp +++ b/source/libmarklin/vehicle.cpp @@ -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