]> git.tdb.fi Git - r2c2.git/commitdiff
Immediately update rods when a vehicle is created
authorMikko Rasa <tdb@tdb.fi>
Sun, 11 Aug 2013 12:33:46 +0000 (15:33 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 11 Aug 2013 12:33:46 +0000 (15:33 +0300)
The initial positions are not guaranteed to, and usually do not satisfy
the constraints.

source/libr2c2/vehicle.cpp

index 2ad716600f50a293ae07c1fa47be0e47fdd4268c..79e3cbef9370f57ce0eaaf4c620e90cd4f72daae 100644 (file)
@@ -33,6 +33,8 @@ Vehicle::Vehicle(Layout &l, const VehicleType &t):
                for(unsigned j=0; j<i->axles.size(); ++j)
                        i->axles[j] = &axles[i->type->first_axle+j];
 
+       update_rods();
+
        layout.add(*this);
 }