Fix GetClosestIndustry with invalid industry type when using cache

pull/428/head
Jonathan G Rennison 2 years ago
parent bc920df63a
commit 613c90e78f

@ -98,6 +98,7 @@ IndustryLocationDistanceCache *IndustryLocationDistanceCache::instance = nullptr
static uint32 GetClosestIndustry(TileIndex tile, IndustryType type, const Industry *current)
{
if (type >= NUM_INDUSTRYTYPES) return UINT32_MAX;
if (IndustryLocationDistanceCache::instance != nullptr) {
IndustryLocationDistanceCache *cache = IndustryLocationDistanceCache::instance;
if (!cache->initialised) {

Loading…
Cancel
Save