(svn r20898) -Change: When entering a production rate, round to nearest possible rate instead towards zero.

This commit is contained in:
frosch 2010-10-04 19:45:27 +00:00
parent 566ba0fccc
commit 168b0a733f
1 changed files with 2 additions and 1 deletions

View File

@ -885,8 +885,9 @@ public:
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();
}