]> git.tdb.fi Git - r2c2.git/commitdiff
Don't collide rays with unplaced vehicles
authorMikko Rasa <tdb@tdb.fi>
Wed, 30 Oct 2013 22:00:39 +0000 (00:00 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 30 Oct 2013 22:00:39 +0000 (00:00 +0200)
source/libr2c2/vehicle.cpp
source/libr2c2/vehicle.h

index 79e3cbef9370f57ce0eaaf4c620e90cd4f72daae..02fb1afce6d4c719367560d3dbf677e208b1c795 100644 (file)
@@ -355,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)
index 11e51d5ca14bae483dcfcc0593e9922502936f1f..33ca7284a6ce837d5378799ad7b6fed5c60397e6 100644 (file)
@@ -107,6 +107,8 @@ public:
        virtual unsigned get_n_link_slots() const;
        virtual Vehicle *get_link(unsigned) const;
        virtual int get_link_slot(const Object &) const;
+
+       virtual bool collide_ray(const Ray &) const;
 };
 
 } // namespace R2C2