Skip to content

Commit 361cc76

Browse files
authored
Merge pull request #3154 from Goober5000/redo_3149
fix a rare crash in the tech room
2 parents e5af389 + 3d976f5 commit 361cc76

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

code/menuui/techmenu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
#define NUM_BUTTONS 16
4545
#define NUM_TABS 3
46-
#define LIST_BUTTONS_MAX 42
46+
#define LIST_BUTTONS_MAX 50
4747

4848
#define SHIPS_DATA_MODE (1<<0)
4949
#define WEAPONS_DATA_MODE (1<<1)
@@ -430,7 +430,7 @@ void tech_common_render()
430430
y = 0;
431431
z = List_offset;
432432
while (y + font_height <= Tech_list_coords[gr_screen.res][SHIP_H_COORD]) {
433-
if (z >= static_cast<int>(Current_list->size())) {
433+
if ((z - List_offset) >= LIST_BUTTONS_MAX || z >= static_cast<int>(Current_list->size())) {
434434
break;
435435
}
436436

0 commit comments

Comments
 (0)