# HG changeset patch # User frosch # Date 2010-10-04 19:45:27 # Node ID 0f363c82e60340d07d2fb091f78582c1d1d6a83a # Parent 927b311c86ca5fd0d107d7ddfc72ef1f49a2fead (svn r20898) -Change: When entering a production rate, round to nearest possible rate instead towards zero. diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp --- 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(); }