(svn r13366) -Fix: clicking in the Subsidies window was broken

This commit is contained in:
smatz 2008-06-03 00:23:54 +00:00
parent def3177d3a
commit 00851610e1

View File

@ -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;
}
}
}
}