diff options
author | frosch <frosch@openttd.org> | 2009-05-31 12:03:14 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-05-31 12:03:14 +0000 |
commit | 9853c0dc224e01cf3394336ab074cbb18592bd5b (patch) | |
tree | 8beff2dc7ba4f4426c471c831bbd7b62c0b8d0e6 /src/roadveh_cmd.cpp | |
parent | 56988b198d6657cda7a404d2f13c0d50ec3eed06 (diff) | |
download | openttd-9853c0dc224e01cf3394336ab074cbb18592bd5b.tar.xz |
(svn r16480) -Fix (r15617): Invalidate newgrf variable caches of more vehicles in more places. Esp. they were only invalidated for trains.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 959fdfffb..d52795f9e 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -137,6 +137,8 @@ void RoadVehUpdateCache(RoadVehicle *v) assert(v->type == VEH_ROAD); assert(IsRoadVehFront(v)); + v->InvalidateNewGRFCacheOfChain(); + for (RoadVehicle *u = v; u != NULL; u = u->Next()) { /* Check the v->first cache. */ assert(u->First() == v); @@ -252,12 +254,15 @@ CommandCost CmdBuildRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint v->cargo_cap = rvi->capacity; AddArticulatedParts(v, VEH_ROAD); + v->InvalidateNewGRFCacheOfChain(); /* Call various callbacks after the whole consist has been constructed */ for (RoadVehicle *u = v; u != NULL; u = u->Next()) { 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); + v->InvalidateNewGRFCache(); + u->InvalidateNewGRFCache(); } VehicleMove(v, false); |