Allow inputting nodename of MaterialItem in ItemSpec::checkItem
authorPerttu Ahola <celeron55@gmail.com>
Wed, 16 Nov 2011 17:10:49 +0000 (19:10 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:48 +0000 (19:13 +0200)
src/inventory.cpp

index 5b99617b3ad615f4d84b202f1f2bfb9daf1f9552..5b29818dc5db89275126a2c21e7f3b4aaa648243 100644 (file)
@@ -1016,8 +1016,13 @@ bool ItemSpec::checkItem(const InventoryItem *item) const
                if(itemname != "MaterialItem")
                        return false;
                MaterialItem *mitem = (MaterialItem*)item;
-               if(mitem->getMaterial() != num)
-                       return false;
+               if(num != 65535){
+                       if(mitem->getMaterial() != num)
+                               return false;
+               } else {
+                       if(mitem->getNodeName() != name)
+                               return false;
+               }
        }
        else if(type == ITEM_CRAFT)
        {