From 792d1bd8835a0ccd8cb13b03338bd2ffd21758fe Mon Sep 17 00:00:00 2001 From: peter1138 Date: Tue, 13 Jan 2009 20:43:53 +0000 Subject: (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. --- src/ai/api/ai_industry.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ai/api/ai_industry.cpp') diff --git a/src/ai/api/ai_industry.cpp b/src/ai/api/ai_industry.cpp index 9a09d5ecd..068a92865 100644 --- a/src/ai/api/ai_industry.cpp +++ b/src/ai/api/ai_industry.cpp @@ -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) -- cgit v1.2.3-54-g00ecf