Client: Don't crash if trying to draw too many items from inventory in HUD

This commit is contained in:
Perttu Ahola 2014-04-27 09:49:00 +03:00
parent 3a6d6e4751
commit 8d31534710
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ void Hud::drawItem(v2s32 upperleftpos, s32 imgsize, s32 itemcount,
NULL, hbar_colors, true);
}
for (s32 i = 0; i < itemcount; i++)
for (s32 i = 0; i < itemcount && (size_t)i < mainlist->getSize(); i++)
{
const ItemStack &item = mainlist->getItem(i);