From 9853c0dc224e01cf3394336ab074cbb18592bd5b Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 31 May 2009 12:03:14 +0000 Subject: (svn r16480) -Fix (r15617): Invalidate newgrf variable caches of more vehicles in more places. Esp. they were only invalidated for trains. --- src/ship_cmd.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ship_cmd.cpp') diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 1ed7a0480..a5c8b9195 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -814,8 +814,12 @@ CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 v->vehicle_flags = 0; if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SetBit(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE); + v->InvalidateNewGRFCacheOfChain(); + v->cargo_cap = GetVehicleProperty(v, 0x0D, svi->capacity); + v->InvalidateNewGRFCacheOfChain(); + VehicleMove(v, false); InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); @@ -948,6 +952,7 @@ CommandCost CmdRefitShip(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 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_SHIPS_LIST, 0); -- cgit v1.2.3-54-g00ecf