From: Perttu Ahola Date: Wed, 16 Nov 2011 17:10:49 +0000 (+0200) Subject: Allow inputting nodename of MaterialItem in ItemSpec::checkItem X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=564c3a9c960e84b69502540d39fcc056fcd4bdf7;p=zefram%2Fminetest%2Fminetest_engine.git Allow inputting nodename of MaterialItem in ItemSpec::checkItem --- diff --git a/src/inventory.cpp b/src/inventory.cpp index 5b99617b..5b29818d 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -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) {