(svn r11236) -Fix [FS#1322]: DeleteVehicleChain can just work as good for all vehicles, instead of not allowing trains to use it (enforced by an assert), but actually using it for trains. Patch by SmatZ.
authorrubidium
Tue, 09 Oct 2007 20:53:25 +0000
changeset 8198 40ad1ae72c99
parent 8197 961f90e66ba5
child 8199 00ee9637c0a0
(svn r11236) -Fix [FS#1322]: DeleteVehicleChain can just work as good for all vehicles, instead of not allowing trains to use it (enforced by an assert), but actually using it for trains. Patch by SmatZ.
src/vehicle.cpp
--- a/src/vehicle.cpp	Tue Oct 09 17:28:37 2007 +0000
+++ b/src/vehicle.cpp	Tue Oct 09 20:53:25 2007 +0000
@@ -564,13 +564,10 @@
 /**
  * Deletes all vehicles in a chain.
  * @param v The first vehicle in the chain.
- *
- * @warning This function is not valid for any vehicle containing articulated
- * parts.
  */
 void DeleteVehicleChain(Vehicle *v)
 {
-	assert(v->type != VEH_TRAIN && v->type != VEH_ROAD);
+	assert(v->First() == v);
 
 	do {
 		Vehicle *u = v;