summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-06-01 15:12:52 +0000
committerfrosch <frosch@openttd.org>2012-06-01 15:12:52 +0000
commitfde15bf393f00501c3bdbce2d6ceb171ac56420c (patch)
tree0235b3ee3a81761c15e0bea67302dad86c74a0fa /src
parent65f51240cde28ea7d778794f48b8b6d022c8995c (diff)
downloadopenttd-fde15bf393f00501c3bdbce2d6ceb171ac56420c.tar.xz
(svn r24314) -Fix: Editing NewGRF parameters using the query window showed wrong values, if there was no direct relation between parameter index and parameter register.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_gui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index df72c3732..56b8c74dc 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -328,9 +328,9 @@ struct NewGRFParametersWindow : public Window {
if (par_info == NULL) par_info = GetDummyParameterInfo(num);
/* One of the arrows is clicked */
+ uint32 old_val = par_info->GetValue(this->grf_config);
if (IsInsideMM(x, 0, SETTING_BUTTON_WIDTH)) {
- uint32 val = par_info->GetValue(this->grf_config);
- uint32 old_val = val;
+ uint32 val = old_val;
if (par_info->type == PTYPE_BOOL) {
val = !val;
} else {
@@ -352,7 +352,7 @@ struct NewGRFParametersWindow : public Window {
}
} else if (par_info->type == PTYPE_UINT_ENUM && click_count >= 2) {
/* Display a query box so users can enter a custom value. */
- SetDParam(0, this->grf_config->param[num]);
+ SetDParam(0, old_val);
ShowQueryString(STR_JUST_INT, STR_CONFIG_SETTING_QUERY_CAPTION, 10, this, CS_NUMERAL, QSF_NONE);
}
this->SetDirty();