summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp5
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);