summaryrefslogtreecommitdiff
path: root/src/newgrf_engine.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-22 11:58:59 +0000
committerrubidium <rubidium@openttd.org>2007-06-22 11:58:59 +0000
commite5c352818d7edfdc5219e4c82f7d5b2083b2b72d (patch)
treefd6fbc96b8d23bef18ed7267fa8174e1689c8e78 /src/newgrf_engine.cpp
parent6159f58948763ed39a457e6ff825a735eea06b23 (diff)
downloadopenttd-e5c352818d7edfdc5219e4c82f7d5b2083b2b72d.tar.xz
(svn r10266) -Codechange: keep track of the origin, time of travel and accumulated feeder share (transfers) of individual pieces of cargo. This means that cargo isn't thrown on a big pile when it's put in a station or unloaded at a station, however the GUI does not reflect these changes yet so you will not actually see it.
Diffstat (limited to 'src/newgrf_engine.cpp')
-rw-r--r--src/newgrf_engine.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index fc2dacdcf..48d06b329 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -705,10 +705,10 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
case 0x39: return v->cargo_type;
case 0x3A: return v->cargo_cap;
case 0x3B: return GB(v->cargo_cap, 8, 8);
- case 0x3C: return v->cargo_count;
- case 0x3D: return GB(v->cargo_count, 8, 8);
- case 0x3E: return v->cargo_source;
- case 0x3F: return v->cargo_days;
+ case 0x3C: return v->cargo.Count();
+ case 0x3D: return GB(v->cargo.Count(), 8, 8);
+ case 0x3E: return v->cargo.Source();
+ case 0x3F: return v->cargo.DaysInTransit();
case 0x40: return v->age;
case 0x41: return GB(v->age, 8, 8);
case 0x42: return v->max_age;
@@ -811,12 +811,12 @@ static const SpriteGroup *VehicleResolveReal(const ResolverObject *object, const
totalsets = in_motion ? group->g.real.num_loaded : group->g.real.num_loading;
- if (v->cargo_count == v->cargo_cap || totalsets == 1) {
+ if (v->cargo.Count() == v->cargo_cap || totalsets == 1) {
set = totalsets - 1;
- } else if (v->cargo_count == 0 || totalsets == 2) {
+ } else if (v->cargo.Empty() || totalsets == 2) {
set = 0;
} else {
- set = v->cargo_count * (totalsets - 2) / max((uint16)1, v->cargo_cap) + 1;
+ set = v->cargo.Count() * (totalsets - 2) / max((uint16)1, v->cargo_cap) + 1;
}
return in_motion ? group->g.real.loaded[set] : group->g.real.loading[set];