summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index ef7e356ea..c74709b43 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1132,6 +1132,7 @@ static void CheckCaches()
Vehicle *v;
FOR_ALL_VEHICLES(v) {
+ extern void FillNewGRFVehicleCache(const Vehicle *v);
if (v != v->First() || v->vehstatus & VS_CRASHED || !v->IsPrimaryVehicle()) continue;
uint length = 0;
@@ -1145,6 +1146,7 @@ static void CheckCaches()
length = 0;
for (const Vehicle *u = v; u != NULL; u = u->Next()) {
+ FillNewGRFVehicleCache(u);
grf_cache[length] = u->grf_cache;
veh_cache[length] = u->vcache;
switch (u->type) {
@@ -1171,6 +1173,7 @@ static void CheckCaches()
length = 0;
for (const Vehicle *u = v; u != NULL; u = u->Next()) {
+ FillNewGRFVehicleCache(u);
if (memcmp(&grf_cache[length], &u->grf_cache, sizeof(NewGRFCache)) != 0) {
DEBUG(desync, 2, "newgrf cache mismatch: type %i, vehicle %i, company %i, unit number %i, wagon %i", (int)v->type, v->index, (int)v->owner, v->unitnumber, length);
}