X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Flibr2c2%2Fvehicle.cpp;h=02fb1afce6d4c719367560d3dbf677e208b1c795;hb=cf38d0a8208fab7ba7aaafc5eed9a86dfc3722a5;hp=2ad716600f50a293ae07c1fa47be0e47fdd4268c;hpb=dd05e8ed55a9072daaf18e4c63c3b66e386ba7f4;p=r2c2.git diff --git a/source/libr2c2/vehicle.cpp b/source/libr2c2/vehicle.cpp index 2ad7166..02fb1af 100644 --- a/source/libr2c2/vehicle.cpp +++ b/source/libr2c2/vehicle.cpp @@ -33,6 +33,8 @@ Vehicle::Vehicle(Layout &l, const VehicleType &t): for(unsigned j=0; jaxles.size(); ++j) i->axles[j] = &axles[i->type->first_axle+j]; + update_rods(); + layout.add(*this); } @@ -353,6 +355,14 @@ int Vehicle::get_link_slot(const Object &other) const return -1; } +bool Vehicle::collide_ray(const Ray &ray) const +{ + if(is_placed()) + return Object::collide_ray(ray); + else + return false; +} + Vehicle::Axle::Axle(const VehicleType::Axle &t): type(&t)