Skip to content
Snippets Groups Projects
Commit f6c6c4f9 authored by Perttu Ahola's avatar Perttu Ahola
Browse files

Load count 0 in itemstring as 1

parent 918c507a
Branches
Tags
No related merge requests found
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment