Mercurial > hg > openttd
changeset 16198:33c9c2277e70 draft
(svn r20898) -Change: When entering a production rate, round to nearest possible rate instead towards zero.
author | frosch <frosch@openttd.org> |
---|---|
date | Mon, 04 Oct 2010 19:45:27 +0000 |
parents | 20c23fbf0eb4 |
children | a17bf6acf794 |
files | src/industry_gui.cpp |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -885,8 +885,9 @@ if (StrEmpty(str)) return; 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); this->SetDirty(); }