summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-10-27 20:37:55 +0000
committerfrosch <frosch@openttd.org>2009-10-27 20:37:55 +0000
commit334b809644fd8055b7e45c790f42ffb1ab990878 (patch)
tree1b3f7e9926621a54e4bacbdd77215d467148f5cc /src/roadveh_cmd.cpp
parent778f6533ea9932ab79d495b08e625f1ffb6fc23e (diff)
downloadopenttd-334b809644fd8055b7e45c790f42ffb1ab990878.tar.xz
(svn r17894) -Fix: Invalidate cache of vehicle vars 40-43 after testruns of certain commands, that change them temporarily.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index b092b4c60..74271a1d7 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -2083,7 +2083,11 @@ CommandCost CmdRefitRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
}
}
- if (flags & DC_EXEC) RoadVehUpdateCache(RoadVehicle::Get(p1)->First());
+ if (flags & DC_EXEC) {
+ RoadVehUpdateCache(RoadVehicle::Get(p1)->First());
+ } else {
+ v->InvalidateNewGRFCacheOfChain(); // always invalidate; querycost might have filled it
+ }
_returned_refit_capacity = total_capacity;