diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-11-16 19:10:49 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-11-29 19:13:48 +0200 |
commit | 564c3a9c960e84b69502540d39fcc056fcd4bdf7 (patch) | |
tree | b6ce08c0e07b3b58170a697fa055ffeb4c1d1f0c /src | |
parent | 4725e5c52e7ad303721214ee2723a250b813ccaf (diff) | |
download | minetest-564c3a9c960e84b69502540d39fcc056fcd4bdf7.tar.gz minetest-564c3a9c960e84b69502540d39fcc056fcd4bdf7.tar.bz2 minetest-564c3a9c960e84b69502540d39fcc056fcd4bdf7.zip |
Allow inputting nodename of MaterialItem in ItemSpec::checkItem
Diffstat (limited to 'src')
-rw-r--r-- | src/inventory.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
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) { |