summaryrefslogtreecommitdiff
path: root/src/newgrf_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r--src/newgrf_gui.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 0db38e297..1473f1877 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -1486,8 +1486,10 @@ private:
this->avails.Sort();
if (this->avail_sel != NULL) {
- this->avail_pos = this->avails.FindIndex(this->avail_sel);
- if (this->avail_pos < 0) this->avail_sel = NULL;
+ this->avail_pos = find_index(this->avails, this->avail_sel);
+ if (this->avail_pos == -1) {
+ this->avail_sel = NULL;
+ }
}
this->vscroll2->SetCount(this->avails.size()); // Update the scrollbar