From 5eddbb338b7838c01087921c77c0738fc12cbfb2 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 13 Apr 2013 13:42:08 +0000 Subject: (svn r25185) -Fix [FS#5508]: Remove ambivalent functions CargoList::Empty() and Count(), and replace them with VehicleCargoList::StoredCount(), TotalCount(), StationCargoList::AvailableCount() and TotalCount(). (fonsinchen) --- src/newgrf_engine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/newgrf_engine.cpp') diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 556958ef3..0c2e190ad 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -768,8 +768,8 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, case 0x39: return v->cargo_type; case 0x3A: return v->cargo_cap; case 0x3B: return GB(v->cargo_cap, 8, 8); - case 0x3C: return ClampToU16(v->cargo.Count()); - case 0x3D: return GB(ClampToU16(v->cargo.Count()), 8, 8); + case 0x3C: return ClampToU16(v->cargo.StoredCount()); + case 0x3D: return GB(ClampToU16(v->cargo.StoredCount()), 8, 8); case 0x3E: return v->cargo.Source(); case 0x3F: return ClampU(v->cargo.DaysInTransit(), 0, 0xFF); case 0x40: return ClampToU16(v->age); @@ -922,7 +922,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, if (totalsets == 0) return NULL; - uint set = (v->cargo.Count() * totalsets) / max((uint16)1, v->cargo_cap); + uint set = (v->cargo.StoredCount() * totalsets) / max((uint16)1, v->cargo_cap); set = min(set, totalsets - 1); return in_motion ? group->loaded[set] : group->loading[set]; -- cgit v1.2.3-54-g00ecf