Mercurial > hg > openttd
changeset 11015:fe0909a41c73 draft
(svn r15355) -Codechange: simplify some stuff now ->FirstShared returns non-NULL again.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Thu, 05 Feb 2009 15:59:23 +0000 |
parents | 1a4a901b1a95 |
children | 84566ff2a186 |
files | src/ai/api/ai_vehiclelist.cpp |
diffstat | 1 files changed, 1 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ai/api/ai_vehiclelist.cpp +++ b/src/ai/api/ai_vehiclelist.cpp @@ -40,12 +40,7 @@ { 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); } }