(svn r23841) -Fix: Clear NewGRF vehicle cache when their owner changes. (esp. vehicle var 43)

This commit is contained in:
frosch 2012-01-22 21:17:38 +00:00
parent a18e077006
commit f591787e4a
1 changed files with 3 additions and 0 deletions

View File

@ -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);