summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-04-16 02:53:55 +0000
committerbelugas <belugas@openttd.org>2007-04-16 02:53:55 +0000
commit436cb4296b15401815b058ed80a6a49b7eafada3 (patch)
tree9c9b590238af91a361712fcfe29ec6d9844f9252 /src/industry_cmd.cpp
parentce4ea342e88ef0714e7044adaec29d7f1ec9b93f (diff)
downloadopenttd-436cb4296b15401815b058ed80a6a49b7eafada3.tar.xz
(svn r9643) -Codechange: Simplify a test.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 084304640..2a403c74a 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1693,6 +1693,7 @@ static void ExtChangeIndustryProduction(Industry *i)
static void UpdateIndustryStatistics(Industry *i)
{
byte pct;
+ bool refresh = false;
if (i->produced_cargo[0] != CT_INVALID) {
pct = 0;
@@ -1707,6 +1708,7 @@ static void UpdateIndustryStatistics(Industry *i)
i->total_transported[0] = i->last_mo_transported[0];
i->last_mo_transported[0] = 0;
+ refresh = true;
}
if (i->produced_cargo[1] != CT_INVALID) {
@@ -1722,10 +1724,11 @@ static void UpdateIndustryStatistics(Industry *i)
i->total_transported[1] = i->last_mo_transported[1];
i->last_mo_transported[1] = 0;
+ refresh = true;
}
- if (i->produced_cargo[0] != CT_INVALID || i->produced_cargo[1] != CT_INVALID)
+ if (refresh)
InvalidateWindow(WC_INDUSTRY_VIEW, i->index);
if (i->prod_level == 0) {