(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

View File

@ -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();
} }