summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-01-22 21:17:38 +0000
committerfrosch <frosch@openttd.org>2012-01-22 21:17:38 +0000
commitf591787e4a6b7f368948f07a7ded1f0b2f3fdffa (patch)
tree3bc89a6eb33ee93c30d99ce1f48e7689e9861a4c /src
parenta18e077006df05b8bd46b150bb06b4fbb9f44d51 (diff)
downloadopenttd-f591787e4a6b7f368948f07a7ded1f0b2f3fdffa.tar.xz
(svn r23841) -Fix: Clear NewGRF vehicle cache when their owner changes. (esp. vehicle var 43)
Diffstat (limited to 'src')
-rw-r--r--src/economy.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 33dfec3cc..d5652cd49 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -419,7 +419,10 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
assert(new_owner != INVALID_OWNER);
v->owner = new_owner;
+
+ /* Owner changes, clear cache */
v->colourmap = PAL_NONE;
+ v->InvalidateNewGRFCache();
if (v->IsEngineCountable()) {
GroupStatistics::CountEngine(v, 1);