forked from mirror/OpenTTD
(svn r16480) -Fix (r15617): Invalidate newgrf variable caches of more vehicles in more places. Esp. they were only invalidated for trains.
This commit is contained in:
@@ -373,6 +373,8 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
v->vehicle_flags = 0;
|
||||
if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SetBit(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE);
|
||||
|
||||
v->InvalidateNewGRFCacheOfChain();
|
||||
|
||||
if (v->cargo_type != CT_PASSENGERS) {
|
||||
uint16 callback = CALLBACK_FAILED;
|
||||
|
||||
@@ -391,6 +393,8 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
u->cargo_cap = 0;
|
||||
}
|
||||
|
||||
v->InvalidateNewGRFCacheOfChain();
|
||||
|
||||
UpdateAircraftCache(v);
|
||||
|
||||
VehicleMove(v, false);
|
||||
@@ -566,6 +570,7 @@ CommandCost CmdRefitAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
v->cargo_type = new_cid;
|
||||
v->cargo_subtype = new_subtype;
|
||||
v->colourmap = PAL_NONE; // invalidate vehicle colour map
|
||||
v->InvalidateNewGRFCacheOfChain();
|
||||
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindowClassesData(WC_AIRCRAFT_LIST, 0);
|
||||
|
Reference in New Issue
Block a user