(svn r15073) -Fix (r15067) [FS#2532]: Default copy constructors don't necessarily do what you want. Instead of creating one, we now pass a pointer around as that avoids additional allocations.
This commit is contained in:
@@ -123,7 +123,9 @@
|
||||
if (!IsValidIndustry(industry_id)) return -1;
|
||||
|
||||
Industry *ind = ::GetIndustry(industry_id);
|
||||
return (int32)::FindStationsAroundTiles(ind->xy, ind->width, ind->height).Length();
|
||||
StationList stations;
|
||||
::FindStationsAroundTiles(ind->xy, ind->width, ind->height, &stations);
|
||||
return (int32)stations.Length();
|
||||
}
|
||||
|
||||
/* static */ int32 AIIndustry::GetDistanceManhattanToTile(IndustryID industry_id, TileIndex tile)
|
||||
|
Reference in New Issue
Block a user