diff options
author | smatz <smatz@openttd.org> | 2008-06-03 00:23:54 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-06-03 00:23:54 +0000 |
commit | e40c7f66d889ba0f78867b26d8ccaf71d07b0574 (patch) | |
tree | 24ba87837dba140d33f5ce5278b964362f802d34 | |
parent | 678f2baf7609823f37d6cd54d06d0be2bebbd7b5 (diff) | |
download | openttd-e40c7f66d889ba0f78867b26d8ccaf71d07b0574.tar.xz |
(svn r13366) -Fix: clicking in the Subsidies window was broken
-rw-r--r-- | src/subsidy_gui.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index d8b39dbc2..76cbf58b4 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -37,23 +37,29 @@ struct SubsidyListWindow : Window { for (const Subsidy *s = _subsidies; s != endof(_subsidies); s++) { if (s->cargo_type != CT_INVALID && s->age < 12) { y -= 10; - if (y < 0) this->HandleClick(s); + if (y < 0) { + this->HandleClick(s); + return; + } num++; } } if (num == 0) { - y -= 10; + y -= 10; /* "None" */ if (y < 0) return; } - y -= 11; + y -= 11; /* "Services already subsidised:" */ if (y < 0) return; for (const Subsidy *s = _subsidies; s != endof(_subsidies); s++) { if (s->cargo_type != CT_INVALID && s->age >= 12) { y -= 10; - if (y < 0) this->HandleClick(s); + if (y < 0) { + this->HandleClick(s); + return; + } } } } |