summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-06-25 15:42:03 +0000
committersmatz <smatz@openttd.org>2009-06-25 15:42:03 +0000
commitfa1ad0fd3c4bb20af746d5ee7588afcb0e5f8375 (patch)
tree30ddcbb431fa267add60ae492912185023e803a3 /src/industry_cmd.cpp
parent8bc244d14e14b898bfaff8bb3ba23704a1168669 (diff)
downloadopenttd-fa1ad0fd3c4bb20af746d5ee7588afcb0e5f8375.tar.xz
(svn r16654) -Codechange: cache industries in station's coverage area instead of searching them everytime payment is made
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 9f404d984..0d93e8c23 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -167,6 +167,8 @@ Industry::~Industry()
DeleteIndustryNews(this->index);
DeleteWindowById(WC_INDUSTRY_VIEW, this->index);
InvalidateWindowData(WC_INDUSTRY_DIRECTORY, 0, 0);
+
+ Station::RecomputeIndustriesNearForAll();
}
static void IndustryDrawSugarMine(const TileInfo *ti)
@@ -1576,6 +1578,8 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const Ind
for (j = 0; j != 50; j++) PlantRandomFarmField(i);
}
InvalidateWindowData(WC_INDUSTRY_DIRECTORY, 0, 0);
+
+ Station::RecomputeIndustriesNearForAll();
}
/** Helper function for Build/Fund an industry