summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-05-31 12:03:14 +0000
committerfrosch <frosch@openttd.org>2009-05-31 12:03:14 +0000
commit9853c0dc224e01cf3394336ab074cbb18592bd5b (patch)
tree8beff2dc7ba4f4426c471c831bbd7b62c0b8d0e6 /src/aircraft_cmd.cpp
parent56988b198d6657cda7a404d2f13c0d50ec3eed06 (diff)
downloadopenttd-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/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 94be6a9b6..134ca6081 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -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);