summaryrefslogtreecommitdiff
path: root/src/newgrf_engine.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-04-13 13:42:08 +0000
committerfrosch <frosch@openttd.org>2013-04-13 13:42:08 +0000
commit5eddbb338b7838c01087921c77c0738fc12cbfb2 (patch)
treee1d1b917bc00b6e7e43aad49188c98b635887b12 /src/newgrf_engine.cpp
parent8d1d521456c57b69243853b369ecc60de0421e33 (diff)
downloadopenttd-5eddbb338b7838c01087921c77c0738fc12cbfb2.tar.xz
(svn r25185) -Fix [FS#5508]: Remove ambivalent functions CargoList::Empty() and Count(), and replace them with VehicleCargoList::StoredCount(), TotalCount(), StationCargoList::AvailableCount() and TotalCount(). (fonsinchen)
Diffstat (limited to 'src/newgrf_engine.cpp')
-rw-r--r--src/newgrf_engine.cpp6
1 files changed, 3 insertions, 3 deletions
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];