Fix issue #1275 - one more missing check.
authorRealBadAngel <maciej.kasatkin@o2.pl>
Tue, 17 Jun 2014 16:18:55 +0000 (18:18 +0200)
committerRealBadAngel <maciej.kasatkin@o2.pl>
Wed, 18 Jun 2014 12:53:43 +0000 (14:53 +0200)
src/serverobject.cpp

index 95735de17ce4a2f36aacba35ab40179acabfe12e..81307bc34f23a69d5f51f8e80bcc96d8b6fb6c9d 100644 (file)
@@ -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();