summaryrefslogtreecommitdiff
path: root/src/object_gui.cpp
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2021-04-29 20:04:50 +0100
committerPeterN <peter@fuzzle.org>2021-06-14 17:49:01 +0100
commit7385e780ac2861ca98e10d660ba4a6351a6b2741 (patch)
treee25428c3d4bec6611960eef318acf1188c790f8c /src/object_gui.cpp
parentc811d42d0c5320ab03b59227379367dedcda53cc (diff)
downloadopenttd-7385e780ac2861ca98e10d660ba4a6351a6b2741.tar.xz
Cleanup: nested_array should not be accessed directly.
Replace accesses with GetWidget() as documented.
Diffstat (limited to 'src/object_gui.cpp')
-rw-r--r--src/object_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/object_gui.cpp b/src/object_gui.cpp
index 05e9b0092..4e5c5815d 100644
--- a/src/object_gui.cpp
+++ b/src/object_gui.cpp
@@ -515,7 +515,7 @@ public:
{
switch (GB(widget, 0, 16)) {
case WID_BO_CLASS_LIST: {
- int num_clicked = this->vscroll->GetPosition() + (pt.y - this->nested_array[widget]->pos_y) / this->line_height;
+ int num_clicked = this->vscroll->GetPosition() + (pt.y - this->GetWidget<NWidgetBase>(widget)->pos_y) / this->line_height;
if (num_clicked >= (int)this->object_classes.size()) break;
this->SelectOtherClass(this->object_classes[num_clicked]);