summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 75603f911..5523f7c91 100644
--- 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")