mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-17 01:12:39 +01:00
(svn r16482) [0.7] -Backport from trunk:
- Fix: [NewGRF] Invalidate NewGRF variable caches of more vehicles in more places. Esp. they were only invalidated for trains (r16480) - Fix: [NewGRF] Call callbacks after initialisation of vehicle variables (r16479) - Fix: [NewGRF] Determining most common (sub-)cargo-type was broken due to someone confusing similiary named variables (r16478) - Fix: Loading indicator when 'unload' in and 'no loading' is off was pointing to the wrong direction [FS#2936] (r16477) - Fix: Track reservation was drawn at bridge heads in the menu (r16470)
This commit is contained in:
@@ -241,13 +241,15 @@ void TrainConsistChanged(Vehicle *v, bool same_length)
|
||||
|
||||
/* Set user defined data to its default value */
|
||||
u->u.rail.user_def_data = rvi_u->user_def_data;
|
||||
u->cache_valid = 0;
|
||||
v->InvalidateNewGRFCache();
|
||||
u->InvalidateNewGRFCache();
|
||||
}
|
||||
|
||||
for (Vehicle *u = v; u != NULL; u = u->Next()) {
|
||||
/* Update user defined data (must be done before other properties) */
|
||||
u->u.rail.user_def_data = GetVehicleProperty(u, 0x25, u->u.rail.user_def_data);
|
||||
u->cache_valid = 0;
|
||||
v->InvalidateNewGRFCache();
|
||||
u->InvalidateNewGRFCache();
|
||||
}
|
||||
|
||||
for (Vehicle *u = v; u != NULL; u = u->Next()) {
|
||||
@@ -333,7 +335,8 @@ void TrainConsistChanged(Vehicle *v, bool same_length)
|
||||
if (!same_length) u->u.rail.cached_veh_length = veh_len;
|
||||
|
||||
v->u.rail.cached_total_length += u->u.rail.cached_veh_length;
|
||||
u->cache_valid = 0;
|
||||
v->InvalidateNewGRFCache();
|
||||
u->InvalidateNewGRFCache();
|
||||
}
|
||||
|
||||
/* store consist weight/max speed in cache */
|
||||
|
||||
Reference in New Issue
Block a user