From f591787e4a6b7f368948f07a7ded1f0b2f3fdffa Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 22 Jan 2012 21:17:38 +0000 Subject: [PATCH] (svn r23841) -Fix: Clear NewGRF vehicle cache when their owner changes. (esp. vehicle var 43) --- src/economy.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/economy.cpp b/src/economy.cpp index 33dfec3ccf..d5652cd491 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);