summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-10-04 19:45:27 +0000
committerfrosch <frosch@openttd.org>2010-10-04 19:45:27 +0000
commit168b0a733f7de8d739e5ccf41ca210fa1db85080 (patch)
treecc4614d3bed0d06a946c14aae80057d76038eb48 /src
parent566ba0fcccbf414c5128bc596486b90ba985c7b5 (diff)
downloadopenttd-168b0a733f7de8d739e5ccf41ca210fa1db85080.tar.xz
(svn r20898) -Change: When entering a production rate, round to nearest possible rate instead towards zero.
Diffstat (limited to 'src')
-rw-r--r--src/industry_gui.cpp3
1 files changed, 2 insertions, 1 deletions
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();
}