aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hud.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hud.cpp b/src/hud.cpp
index 750755649..343b548e9 100644
--- a/src/hud.cpp
+++ b/src/hud.cpp
@@ -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);