Mercurial > hg > openttd
changeset 9259:eaa1bd5adde5 draft
(svn r13125) -Fix [FS#2000](r12913): [autoreplace] failing replacement and restoring a vehicle will no longer decrease the vehicle count in groups
author | bjarni <bjarni@openttd.org> |
---|---|
date | Fri, 16 May 2008 21:04:49 +0000 (2008-05-16) |
parents | 1cd16b63b893 |
children | 17e409b6a3d9 |
files | src/vehicle.cpp |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2757,7 +2757,11 @@ memcpy(dest, backup, sizeof(Vehicle)); /* We decreased the engine count when we sold the engines so we will increase it again. */ - if (IsEngineCountable(backup)) p->num_engines[backup->engine_type]++; + if (IsEngineCountable(backup)) { + p->num_engines[backup->engine_type]++; + if (IsValidGroupID(backup->group_id)) GetGroup(backup->group_id)->num_engines[backup->engine_type]++; + if (backup->IsPrimaryVehicle()) IncreaseGroupNumVehicle(backup->group_id); + } /* Update hash. */ Vehicle *dummy = dest;