Fix issue with more than two rct_scrolls not working

This commit is contained in:
Sijmen Schoon 2018-08-02 12:49:53 +02:00 committed by Aaron van Geffen
parent 2e64bdbe26
commit 2e95c64a7c
1 changed files with 2 additions and 4 deletions

View File

@ -862,14 +862,12 @@ void widget_scroll_get_part(
rct_window* w, rct_widget* widget, int32_t x, int32_t y, int32_t* output_x, int32_t* output_y, int32_t* output_scroll_area,
int32_t* scroll_id)
{
rct_widget* iterator = w->widgets;
*scroll_id = 0;
while (++iterator != widget)
for (rct_widget* iterator = w->widgets; iterator != widget; iterator++)
{
if (iterator->type == WWT_SCROLL)
{
(*scroll_id)++;
break;
*scroll_id += 1;
}
}