projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
918c507
)
Load count 0 in itemstring as 1
author
Perttu Ahola
<celeron55@gmail.com>
Wed, 30 Nov 2011 22:04:21 +0000
(
00:04
+0200)
committer
Perttu Ahola
<celeron55@gmail.com>
Wed, 30 Nov 2011 22:04:21 +0000
(
00:04
+0200)
src/inventory.cpp
patch
|
blob
|
history
diff --git
a/src/inventory.cpp
b/src/inventory.cpp
index 75603f9115206de460d08038691969b3bd95b450..5523f7c91fd1cc810749c2d63553f8c7a7ff59ed 100644
(file)
--- a/
src/inventory.cpp
+++ b/
src/inventory.cpp
@@
-114,6
+114,8
@@
InventoryItem* InventoryItem::deSerialize(std::istream &is, IGameDef *gamedef)
}
fnd.skip_over(" ");
u16 count = stoi(trim(fnd.next("")));
+ if(count == 0)
+ count = 1;
return new MaterialItem(gamedef, nodename, count);
}
else if(name == "MBOItem")
@@
-140,6
+142,8
@@
InventoryItem* InventoryItem::deSerialize(std::istream &is, IGameDef *gamedef)
// Then read count
fnd.skip_over(" ");
u16 count = stoi(trim(fnd.next("")));
+ if(count == 0)
+ count = 1;
return new CraftItem(gamedef, subname, count);
}
else if(name == "ToolItem")