summaryrefslogtreecommitdiff
path: root/src/ai
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
commit580f6fcbab7991385c14427c1a39ac7fd95f2eb3 (patch)
tree0d1c996783711a061eca31db4b020ee364f764af /src/ai
parent20cb3a581c38d840dc5df4fc149d8d7b002e6a00 (diff)
downloadopenttd-580f6fcbab7991385c14427c1a39ac7fd95f2eb3.tar.xz
(svn r15355) -Codechange: simplify some stuff now ->FirstShared returns non-NULL again.
Diffstat (limited to 'src/ai')
-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);
}
}