summaryrefslogtreecommitdiff
path: root/src/ai/api
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-02-05 15:59:23 +0000
committerrubidium <rubidium@openttd.org>2009-02-05 15:59:23 +0000
commit8fb4962407f1fa72fb8c8f7340254e44e97c5efd (patch)
tree0d1c996783711a061eca31db4b020ee364f764af /src/ai/api
parentb7c7a1f70100957232172959ad9e532c5d3237ba (diff)
downloadopenttd-8fb4962407f1fa72fb8c8f7340254e44e97c5efd.tar.xz
(svn r15355) -Codechange: simplify some stuff now ->FirstShared returns non-NULL again.
Diffstat (limited to 'src/ai/api')
-rw-r--r--src/ai/api/ai_vehiclelist.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ai/api/ai_vehiclelist.cpp b/src/ai/api/ai_vehiclelist.cpp
index 1c099910b..a08357b06 100644
--- a/src/ai/api/ai_vehiclelist.cpp
+++ b/src/ai/api/ai_vehiclelist.cpp
@@ -40,12 +40,7 @@ AIVehicleList_SharedOrders::AIVehicleList_SharedOrders(VehicleID vehicle_id)
{
if (!AIVehicle::IsValidVehicle(vehicle_id)) return;
- Vehicle *v = GetVehicle(vehicle_id)->FirstShared();
- if (v == NULL) {
- this->AddItem(vehicle_id);
- return;
- }
- for (; v != NULL; v->NextShared()) {
+ for (const Vehicle *v = GetVehicle(vehicle_id)->FirstShared(); v != NULL; v->NextShared()) {
this->AddItem(v->index);
}
}