X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fvehicle.cpp;h=cb776f413daacb20f82889076aeab17e451cc842;hb=e3f081a762c1bd21c051590540d21ec21e9b36b1;hp=02fb1afce6d4c719367560d3dbf677e208b1c795;hpb=26a8dbeae14c685c6aef1aad3aa75c6f1a75e458;p=r2c2.git diff --git a/source/libr2c2/vehicle.cpp b/source/libr2c2/vehicle.cpp index 02fb1af..cb776f4 100644 --- a/source/libr2c2/vehicle.cpp +++ b/source/libr2c2/vehicle.cpp @@ -175,7 +175,8 @@ void Vehicle::update_position(int sign) { OrientedPoint p = placement.get_point(); position = p.position; - position.z += layout.get_catalogue().get_rail_elevation(); + // TODO Move the z adjustment to VehiclePlacement + position.z += placement.get_position(VehiclePlacement::FRONT_AXLE)->get_type().get_appearance().get_rail_elevation(); rotation = p.rotation; tilt = p.tilt; @@ -247,7 +248,7 @@ void Vehicle::propagate_backward() void Vehicle::check_sensor(const TrackOffsetIter &t, unsigned &sensor, bool release) { - unsigned s = t->get_sensor_id(); + unsigned s = t->get_sensor_address(); if(s!=sensor) { unsigned old = sensor; @@ -355,10 +356,10 @@ int Vehicle::get_link_slot(const Object &other) const return -1; } -bool Vehicle::collide_ray(const Ray &ray) const +bool Vehicle::collide_ray(const Ray &ray, float *d) const { if(is_placed()) - return Object::collide_ray(ray); + return Object::collide_ray(ray, d); else return false; }