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/train_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/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index d0d09a2ff..91a4bccd2 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -241,13 +241,15 @@ void TrainConsistChanged(Train *v, bool same_length) /* Set user defined data to its default value */ u->tcache.user_def_data = rvi_u->user_def_data; - u->vcache.cache_valid = 0; + v->InvalidateNewGRFCache(); + u->InvalidateNewGRFCache(); } for (Train *u = v; u != NULL; u = u->Next()) { /* Update user defined data (must be done before other properties) */ u->tcache.user_def_data = GetVehicleProperty(u, 0x25, u->tcache.user_def_data); - u->vcache.cache_valid = 0; + v->InvalidateNewGRFCache(); + u->InvalidateNewGRFCache(); } for (Train *u = v; u != NULL; u = u->Next()) { @@ -333,7 +335,8 @@ void TrainConsistChanged(Train *v, bool same_length) if (!same_length) u->tcache.cached_veh_length = veh_len; v->tcache.cached_total_length += u->tcache.cached_veh_length; - u->vcache.cache_valid = 0; + v->InvalidateNewGRFCache(); + u->InvalidateNewGRFCache(); } /* store consist weight/max speed in cache */ |