From 168b0a733f7de8d739e5ccf41ca210fa1db85080 Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 4 Oct 2010 19:45:27 +0000 Subject: (svn r20898) -Change: When entering a production rate, round to nearest possible rate instead towards zero. --- src/industry_gui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index f55a896e2..fe26676be 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -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(); } -- cgit v1.2.3-70-g09d2