(svn r7459) -Fix: make sure TrainConsistChanged() is called for the first vehicle of a chain after reffiting
authorglx
Sat, 09 Dec 2006 20:14:26 +0000
changeset 5303 5a3fa9dfe40b
parent 5302 a6155fb1df05
child 5304 50daae4d7d38
(svn r7459) -Fix: make sure TrainConsistChanged() is called for the first vehicle of a chain after reffiting
because free wagons present in depot can have the same type as the one bought and refitted by autoreplace
train_cmd.c
--- a/train_cmd.c	Sat Dec 09 19:53:56 2006 +0000
+++ b/train_cmd.c	Sat Dec 09 20:14:26 2006 +0000
@@ -1892,7 +1892,7 @@
 	_returned_refit_capacity = num;
 
 	/* Update the train's cached variables */
-	if (flags & DC_EXEC) TrainConsistChanged(GetVehicle(p1));
+	if (flags & DC_EXEC) TrainConsistChanged(GetFirstVehicleInChain(GetVehicle(p1)));
 
 	return cost;
 }