(svn r9896) -Fix (r9874): when selling an entire train, decrease the number of vehicles in the group only once
authorglx
Mon, 21 May 2007 17:19:01 +0000
changeset 6665 df9d1f91abcc
parent 6664 aed6a5b1c992
child 6666 41ceafa4c85e
(svn r9896) -Fix (r9874): when selling an entire train, decrease the number of vehicles in the group only once
src/vehicle.cpp
--- a/src/vehicle.cpp	Mon May 21 16:58:23 2007 +0000
+++ b/src/vehicle.cpp	Mon May 21 17:19:01 2007 +0000
@@ -585,7 +585,7 @@
 		if (v->owner == _local_player) InvalidateAutoreplaceWindow(v->engine_type);
 
 		if (IsValidGroupID(v->group_id)) GetGroup(v->group_id)->num_engines[v->engine_type]--;
-		DecreaseGroupNumVehicle(v->group_id);
+		if (v->type != VEH_TRAIN || IsFrontEngine(v)) DecreaseGroupNumVehicle(v->group_id);
 	}
 
 	DeleteVehicleNews(v->index, INVALID_STRING_ID);