summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-01 22:10:54 +0000
committerrubidium <rubidium@openttd.org>2007-08-01 22:10:54 +0000
commit4e96ce3dfea13ffab951a93061e35423e0b321e5 (patch)
treee6ac6f2443373cc3523acedc8b0e458b99955651 /src/vehicle.cpp
parent435d39f8fb5c2e3a40e6e0c7344ba4b1531a6844 (diff)
downloadopenttd-4e96ce3dfea13ffab951a93061e35423e0b321e5.tar.xz
(svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 7c3c5a4db..fbc061c62 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -355,7 +355,7 @@ static Vehicle *AllocateSingleVehicle(VehicleID *skip_vehicles)
/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
* @todo - This is just a temporary stage, this will be removed. */
- if (*skip_vehicles < (_Vehicle_pool.total_items - offset)) { // make sure the offset in the array is not larger than the array itself
+ if (*skip_vehicles < (_Vehicle_pool.GetSize() - offset)) { // make sure the offset in the array is not larger than the array itself
for (v = GetVehicle(offset + *skip_vehicles); v != NULL; v = (v->index + 1U < GetVehiclePoolSize()) ? GetVehicle(v->index + 1) : NULL) {
(*skip_vehicles)++;
if (!IsValidVehicle(v)) return InitializeVehicle(v);