mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r20898) -Change: When entering a production rate, round to nearest possible rate instead towards zero.
This commit is contained in:
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
Block a user