Skip to content

Commit 8d31534

Browse files
committedApr 27, 2014
Client: Don't crash if trying to draw too many items from inventory in HUD
1 parent 3a6d6e4 commit 8d31534

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/hud.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void Hud::drawItem(v2s32 upperleftpos, s32 imgsize, s32 itemcount,
127127
NULL, hbar_colors, true);
128128
}
129129

130-
for (s32 i = 0; i < itemcount; i++)
130+
for (s32 i = 0; i < itemcount && (size_t)i < mainlist->getSize(); i++)
131131
{
132132
const ItemStack &item = mainlist->getItem(i);
133133

0 commit comments

Comments
 (0)
Please sign in to comment.