projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4725e5c
)
Allow inputting nodename of MaterialItem in ItemSpec::checkItem
author
Perttu Ahola
<celeron55@gmail.com>
Wed, 16 Nov 2011 17:10:49 +0000
(19:10 +0200)
committer
Perttu Ahola
<celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:48 +0000
(19:13 +0200)
src/inventory.cpp
patch
|
blob
|
history
diff --git
a/src/inventory.cpp
b/src/inventory.cpp
index 5b99617b3ad615f4d84b202f1f2bfb9daf1f9552..5b29818dc5db89275126a2c21e7f3b4aaa648243 100644
(file)
--- 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)
{