aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2014-04-27 09:49:00 +0300
committerPerttu Ahola <celeron55@gmail.com>2014-04-27 09:49:19 +0300
commit8d315347100f1d261bb496b6c73f8cab5d2b7a41 (patch)
tree05c7d298ee1ee9161698833426c4483fdec803e9 /src
parent3a6d6e475158c3fff8317098535ff61af4d4c20b (diff)
downloadminetest-8d315347100f1d261bb496b6c73f8cab5d2b7a41.tar.gz
minetest-8d315347100f1d261bb496b6c73f8cab5d2b7a41.tar.bz2
minetest-8d315347100f1d261bb496b6c73f8cab5d2b7a41.zip
Client: Don't crash if trying to draw too many items from inventory in HUD
Diffstat (limited to 'src')
-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);