mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r9643) -Codechange: Simplify a test.
This commit is contained in:
parent
83c269d071
commit
61c99f99a2
@ -1693,6 +1693,7 @@ static void ExtChangeIndustryProduction(Industry *i)
|
|||||||
static void UpdateIndustryStatistics(Industry *i)
|
static void UpdateIndustryStatistics(Industry *i)
|
||||||
{
|
{
|
||||||
byte pct;
|
byte pct;
|
||||||
|
bool refresh = false;
|
||||||
|
|
||||||
if (i->produced_cargo[0] != CT_INVALID) {
|
if (i->produced_cargo[0] != CT_INVALID) {
|
||||||
pct = 0;
|
pct = 0;
|
||||||
@ -1707,6 +1708,7 @@ static void UpdateIndustryStatistics(Industry *i)
|
|||||||
|
|
||||||
i->total_transported[0] = i->last_mo_transported[0];
|
i->total_transported[0] = i->last_mo_transported[0];
|
||||||
i->last_mo_transported[0] = 0;
|
i->last_mo_transported[0] = 0;
|
||||||
|
refresh = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i->produced_cargo[1] != CT_INVALID) {
|
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->total_transported[1] = i->last_mo_transported[1];
|
||||||
i->last_mo_transported[1] = 0;
|
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);
|
InvalidateWindow(WC_INDUSTRY_VIEW, i->index);
|
||||||
|
|
||||||
if (i->prod_level == 0) {
|
if (i->prod_level == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user