(svn r17472) -Fix [FS#3182]: industry list was rebuilt too early during industry removal causing the removed industry to be still in the list after removal

pull/155/head
rubidium 15 years ago
parent 08d9873001
commit 6b25288ba1

@ -84,6 +84,7 @@ struct Industry : IndustryPool::PoolItem<&_industry_pool> {
}
static Industry *GetRandom();
static void PostDestructor(size_t index);
};
void PlantRandomFarmField(const Industry *i);

@ -176,10 +176,18 @@ Industry::~Industry()
DeleteIndustryNews(this->index);
DeleteWindowById(WC_INDUSTRY_VIEW, this->index);
InvalidateWindowData(WC_INDUSTRY_DIRECTORY, 0, 0);
DeleteSubsidyWith(ST_INDUSTRY, this->index);
CargoPacket::InvalidateAllFrom(ST_INDUSTRY, this->index);
}
/**
* Invalidating some stuff after removing item from the pool.
* @param index index of deleted item
*/
void Industry::PostDestructor(size_t index)
{
InvalidateWindowData(WC_INDUSTRY_DIRECTORY, 0, 0);
Station::RecomputeIndustriesNearForAll();
}

Loading…
Cancel
Save