Fix memory error for listbox when clicking in the region where there are no items
This commit is contained in:
parent
f3ca7b4067
commit
40ecc65268
|
@ -1,5 +1,9 @@
|
||||||
D1X-Rebirth Changelog
|
D1X-Rebirth Changelog
|
||||||
|
|
||||||
|
20100313
|
||||||
|
--------
|
||||||
|
main/newmenu.c: Fix memory error for listbox when clicking in the region where there are no items
|
||||||
|
|
||||||
20100310
|
20100310
|
||||||
--------
|
--------
|
||||||
main/titles.c: Put most local variables in show_briefing in 'briefing' struct, to make briefing a window in future
|
main/titles.c: Put most local variables in show_briefing in 'briefing' struct, to make briefing a window in future
|
||||||
|
|
|
@ -1859,7 +1859,7 @@ int listbox_idle(window *wind, listbox *lb)
|
||||||
|
|
||||||
mouse_get_pos(&mx, &my, &mz);
|
mouse_get_pos(&mx, &my, &mz);
|
||||||
for (i=lb->first_item; i<lb->first_item+LB_ITEMS_ON_SCREEN; i++ ) {
|
for (i=lb->first_item; i<lb->first_item+LB_ITEMS_ON_SCREEN; i++ ) {
|
||||||
if (i > lb->nitems)
|
if (i >= lb->nitems)
|
||||||
break;
|
break;
|
||||||
gr_get_string_size(lb->item[i], &w, &h, &aw );
|
gr_get_string_size(lb->item[i], &w, &h, &aw );
|
||||||
x1 = lb->box_x;
|
x1 = lb->box_x;
|
||||||
|
|
Loading…
Reference in a new issue