summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-09-09 14:39:48 +0000
committerrubidium <rubidium@openttd.org>2010-09-09 14:39:48 +0000
commit3ebf8a297e6320d3cdf771fdf7393c1fb1e79fc9 (patch)
tree4ad39a8aee9b5177e29349ec38c24a9953f6d58c
parent976ee2a91e9b3ea10105c817c9b299cdfe4e5f8b (diff)
downloadopenttd-3ebf8a297e6320d3cdf771fdf7393c1fb1e79fc9.tar.xz
(svn r20776) -Codechange: make VehicleLists for the group "ALL_GROUP" work as well
-rw-r--r--src/vehiclelist.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/vehiclelist.cpp b/src/vehiclelist.cpp
index a0415969b..5303e1904 100644
--- a/src/vehiclelist.cpp
+++ b/src/vehiclelist.cpp
@@ -139,6 +139,18 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli
}
break;
+ case VL_GROUP_LIST:
+ if (vli.index != ALL_GROUP) {
+ FOR_ALL_VEHICLES(v) {
+ if (v->type == vli.vtype && v->IsPrimaryVehicle() &&
+ v->owner == vli.company && v->group_id == vli.index) {
+ *list->Append() = v;
+ }
+ }
+ break;
+ }
+ /* FALL THROUGH */
+
case VL_STANDARD:
FOR_ALL_VEHICLES(v) {
if (v->type == vli.vtype && v->owner == vli.company && v->IsPrimaryVehicle()) {
@@ -162,15 +174,6 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli
}
break;
- case VL_GROUP_LIST:
- FOR_ALL_VEHICLES(v) {
- if (v->type == vli.vtype && v->IsPrimaryVehicle() &&
- v->owner == vli.company && v->group_id == vli.index) {
- *list->Append() = v;
- }
- }
- break;
-
default: return false;
}