(svn r9643) -Codechange: Simplify a test.
authorbelugas
Mon, 16 Apr 2007 02:53:55 +0000
changeset 6467 7bce7e0c9937
parent 6466 674d898f2997
child 6468 ab54a3aeeacd
(svn r9643) -Codechange: Simplify a test.
src/industry_cmd.cpp
--- a/src/industry_cmd.cpp	Mon Apr 16 02:47:01 2007 +0000
+++ b/src/industry_cmd.cpp	Mon Apr 16 02:53:55 2007 +0000
@@ -1693,6 +1693,7 @@
 static void UpdateIndustryStatistics(Industry *i)
 {
 	byte pct;
+	bool refresh = false;
 
 	if (i->produced_cargo[0] != CT_INVALID) {
 		pct = 0;
@@ -1707,6 +1708,7 @@
 
 		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 @@
 
 		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) {