diff --git a/src/news_item.c b/src/news_item.c index 986502d1fe..0d2986aba3 100644 --- a/src/news_item.c +++ b/src/news_item.c @@ -252,7 +252,7 @@ void news_item_add_to_queue(uint8 type, rct_string_id string_id, uint32 assoc) // find first open slot while (newsItem->type != NEWS_ITEM_NULL) { - if (newsItem + sizeof(newsItem) >= (rct_news_item*)0x13CB1CC) + if (newsItem + 1 >= (rct_news_item*)0x13CB1CC) news_item_close_current(); else newsItem++; diff --git a/src/scenario.c b/src/scenario.c index 9154ce9e81..a2fe85aa31 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -420,10 +420,10 @@ void scenario_objective8_check() ride->excitement >= RIDE_RATING(7,00) && type_already_counted[subtype_id] == 0){ // this calculates the length, no idea why it's done so complicated though. - uint8 limit = ride->pad_088[63]; + uint8 limit = ride->var_0C7; uint32 sum = 0; for (int j = 0; j < limit; ++j) { - sum += ((uint32*)&ride->pad_088[92])[j]; + sum += ((uint32*)&ride->var_0E4)[j]; } if ((sum >> 16) > (uint32)objective_length) { type_already_counted[subtype_id]++; diff --git a/src/window.c b/src/window.c index 6fba666fe7..99368a0aff 100644 --- a/src/window.c +++ b/src/window.c @@ -234,7 +234,7 @@ static int window_wheel_input(rct_window *w, int wheel) continue; // Originally always checked first scroll view, bug maybe? - scroll = &w->scrolls[i * sizeof(rct_scroll)]; + scroll = &w->scrolls[i]; if (scroll->flags & (HSCROLLBAR_VISIBLE | VSCROLLBAR_VISIBLE)) { window_scroll_wheel_input(w, i, wheel); return 1; @@ -308,7 +308,7 @@ static void window_all_wheel_input() if (widgetIndex != -1) { widget = &w->widgets[widgetIndex]; if (widget->type == WWT_SCROLL) { - scroll = &w->scrolls[RCT2_GLOBAL(0x01420075, uint8) * sizeof(rct_scroll)]; + scroll = &w->scrolls[RCT2_GLOBAL(0x01420075, uint8)]; if (scroll->flags & (HSCROLLBAR_VISIBLE | VSCROLLBAR_VISIBLE)) { window_scroll_wheel_input(w, window_get_scroll_index(w, widgetIndex), wheel); return;