mirror of https://github.com/OpenTTD/OpenTTD
(svn r20898) -Change: When entering a production rate, round to nearest possible rate instead towards zero.
parent
566ba0fccc
commit
168b0a733f
|
@ -885,8 +885,9 @@ public:
|
||||||
if (StrEmpty(str)) return;
|
if (StrEmpty(str)) return;
|
||||||
|
|
||||||
Industry *i = Industry::Get(this->window_number);
|
Industry *i = Industry::Get(this->window_number);
|
||||||
|
uint value = atoi(str);
|
||||||
|
|
||||||
i->production_rate[this->editbox_line - IL_RATE1] = ClampU(atoi(str) / 8, 0, 255);
|
i->production_rate[this->editbox_line - IL_RATE1] = ClampU(RoundDivSU(value, 8), 0, 255);
|
||||||
UpdateIndustryProduction(i);
|
UpdateIndustryProduction(i);
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue