# HG changeset patch # User tron # Date 1170491422 0 # Node ID 7799711a9a23ba1ed36731b3f8c576431cb554ef # Parent 11848ca714f424e347d85d65165e7037a457ef80 (svn r8549) -Fix Do not check whether the end of the depot array has been reached when building an aircraft. This cannot happen, just assert it really does not happen diff -r 11848ca714f4 -r 7799711a9a23 src/aircraft_cmd.cpp --- a/src/aircraft_cmd.cpp Sat Feb 03 07:54:13 2007 +0000 +++ b/src/aircraft_cmd.cpp Sat Feb 03 08:30:22 2007 +0000 @@ -338,24 +338,17 @@ _new_vehicle_id = v->index; - v->u.air.pos = MAX_ELEMENTS; - /* When we click on hangar we know the tile it is on. By that we know * its position in the array of depots the airport has.....we can search * layout for #th position of depot. Since layout must start with a listing * of all depots, it is simple */ - { - uint i; - - for (i = 0; i < apc->nof_depots; i++) { - if (st->airport_tile + ToTileIndexDiff(apc->airport_depots[i]) == tile) { - assert(apc->layout[i].heading == HANGAR); - v->u.air.pos = apc->layout[i].position; - break; - } + for (uint i = 0;; i++) { + assert(i != apc->nof_depots); + if (st->airport_tile + ToTileIndexDiff(apc->airport_depots[i]) == tile) { + assert(apc->layout[i].heading == HANGAR); + v->u.air.pos = apc->layout[i].position; + break; } - // to ensure v->u.air.pos has been given a value - assert(v->u.air.pos != MAX_ELEMENTS); } v->u.air.state = HANGAR;