diff options
author | rubidium <rubidium@openttd.org> | 2007-05-19 12:29:09 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-05-19 12:29:09 +0000 |
commit | 86bb5cc2a68c68737d01cd5878e96856eba1950f (patch) | |
tree | fe7f35a2a523a229003b1ff4d2b5ffd100d5d743 /src/vehicle.cpp | |
parent | 44b7f10db102fe0a541a1c582ec154962e73ed01 (diff) | |
download | openttd-86bb5cc2a68c68737d01cd5878e96856eba1950f.tar.xz |
(svn r9878) -Fix (9874): some vehicle count's were not properly updated on delete or autoreplace of vehicles.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index c102108ae..8ff8d1de8 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -584,7 +584,8 @@ void DestroyVehicle(Vehicle *v) GetPlayer(v->owner)->num_engines[v->engine_type]--; if (v->owner == _local_player) InvalidateAutoreplaceWindow(v->engine_type); - if (!IsDefaultGroupID(v->group_id) && IsValidGroupID(v->group_id)) GetGroup(v->group_id)->num_engines[v->engine_type]--; + if (IsValidGroupID(v->group_id)) GetGroup(v->group_id)->num_engines[v->engine_type]--; + DecreaseGroupNumVehicle(v->group_id); } DeleteVehicleNews(v->index, INVALID_STRING_ID); |