aboutsummaryrefslogtreecommitdiff
path: root/src/serverobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/serverobject.cpp')
-rw-r--r--src/serverobject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/serverobject.cpp b/src/serverobject.cpp
index 95735de17..81307bc34 100644
--- a/src/serverobject.cpp
+++ b/src/serverobject.cpp
@@ -78,7 +78,7 @@ ItemStack ServerActiveObject::getWieldedItem() const
if(inv)
{
const InventoryList *list = inv->getList(getWieldList());
- if(list)
+ if(list && (getWieldIndex() < (s32)list->getSize()))
return list->getItem(getWieldIndex());
}
return ItemStack();