summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-23 09:10:56 +0000
committerrubidium <rubidium@openttd.org>2009-05-23 09:10:56 +0000
commit6237fe146228e84761c6aba14bf7acf6c359f061 (patch)
tree0ff89de7f14a652d59d972e949761819642296a4 /src/roadveh_cmd.cpp
parentda5661a0c8870c532c393ec3d330c3fbb44eb8ac (diff)
downloadopenttd-6237fe146228e84761c6aba14bf7acf6c359f061.tar.xz
(svn r16394) -Codechange: move (NewGRF) cache variables into a separate struct so (some vehicle related) NewGRF cache 'desyncs' can be tested easier.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index cdc797e06..f6bf44a88 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -142,10 +142,10 @@ void RoadVehUpdateCache(RoadVehicle *v)
assert(u->First() == v);
/* Update the 'first engine' */
- u->first_engine = (v == u) ? INVALID_ENGINE : v->engine_type;
+ u->rcache.first_engine = (v == u) ? INVALID_ENGINE : v->engine_type;
/* Update the length of the vehicle. */
- u->cached_veh_length = GetRoadVehLength(u);
+ u->rcache.cached_veh_length = GetRoadVehLength(u);
/* Invalidate the vehicle colour map */
u->colourmap = PAL_NONE;
@@ -244,7 +244,7 @@ CommandCost CmdBuildRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
v->roadtype = HasBit(EngInfo(v->engine_type)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD;
v->compatible_roadtypes = RoadTypeToRoadTypes(v->roadtype);
- v->cached_veh_length = 8;
+ v->rcache.cached_veh_length = 8;
v->vehicle_flags = 0;
if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SetBit(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE);
@@ -255,7 +255,7 @@ CommandCost CmdBuildRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
/* Call various callbacks after the whole consist has been constructed */
for (RoadVehicle *u = v; u != NULL; u = u->Next()) {
- u->cached_veh_length = GetRoadVehLength(u);
+ u->rcache.cached_veh_length = GetRoadVehLength(u);
/* Cargo capacity is zero if and only if the vehicle cannot carry anything */
if (u->cargo_cap != 0) u->cargo_cap = GetVehicleProperty(u, 0x0F, u->cargo_cap);
}
@@ -1582,7 +1582,7 @@ again:
* it's on a depot tile, check if it's time to activate the next vehicle in
* the chain yet. */
if (v->Next() != NULL && IsRoadDepotTile(v->tile)) {
- if (v->frame == v->cached_veh_length + RVC_DEPOT_START_FRAME) {
+ if (v->frame == v->rcache.cached_veh_length + RVC_DEPOT_START_FRAME) {
RoadVehLeaveDepot(v->Next(), false);
}
}