mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-08 07:21:53 +00:00
(svn r13125) -Fix [FS#2000](r12913): [autoreplace] failing replacement and restoring a vehicle will no longer decrease the vehicle count in groups
This commit is contained in:
parent
ced7ee3043
commit
5469686001
@ -2757,7 +2757,11 @@ Vehicle* BackuppedVehicle::RestoreBackupVehicle(Vehicle *v, Player *p)
|
|||||||
memcpy(dest, backup, sizeof(Vehicle));
|
memcpy(dest, backup, sizeof(Vehicle));
|
||||||
|
|
||||||
/* We decreased the engine count when we sold the engines so we will increase it again. */
|
/* 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. */
|
/* Update hash. */
|
||||||
Vehicle *dummy = dest;
|
Vehicle *dummy = dest;
|
||||||
|
Loading…
Reference in New Issue
Block a user