From 116a5f56a4c1362446bcf921e4436a19057d105e Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 20 Mar 2010 14:30:16 +0000 Subject: (svn r19481) -Codechange: Turn _industry_counts into a static member of Industry. --- src/newgrf_industries.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/newgrf_industries.cpp') diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index ceff4923f..f5d5301fa 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -135,7 +135,7 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout /* If the filter is 0, it could be because none was specified as well as being really a 0. * In either case, just do the regular var67 */ closest_dist = GetClosestIndustry(current->location.tile, ind_index, current); - count = GetIndustryTypeCount(ind_index); + count = min(Industry::GetIndustryTypeCount(ind_index), UINT8_MAX); // clamp to 8 bit } else { /* Count only those who match the same industry type and layout filter * Unfortunately, we have to do it manually */ @@ -465,7 +465,7 @@ CommandCost CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uin Industry ind; ind.index = INVALID_INDUSTRY; ind.location.tile = tile; - ind.location.w = 0; + ind.location.w = 0; // important to mark the industry invalid ind.type = type; ind.selected_layout = layout; ind.town = ClosestTownFromTile(tile, UINT_MAX); -- cgit v1.2.3-54-g00ecf