From 564c3a9c960e84b69502540d39fcc056fcd4bdf7 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Wed, 16 Nov 2011 19:10:49 +0200 Subject: Allow inputting nodename of MaterialItem in ItemSpec::checkItem --- src/inventory.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/inventory.cpp') diff --git a/src/inventory.cpp b/src/inventory.cpp index 5b99617b3..5b29818dc 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) { -- cgit v1.2.3