mirror of
https://github.com/minetest/minetest.git
synced 2025-01-11 15:57:29 +01:00
Load count 0 in itemstring as 1
This commit is contained in:
parent
918c507a66
commit
f6c6c4f917
@ -114,6 +114,8 @@ InventoryItem* InventoryItem::deSerialize(std::istream &is, IGameDef *gamedef)
|
|||||||
}
|
}
|
||||||
fnd.skip_over(" ");
|
fnd.skip_over(" ");
|
||||||
u16 count = stoi(trim(fnd.next("")));
|
u16 count = stoi(trim(fnd.next("")));
|
||||||
|
if(count == 0)
|
||||||
|
count = 1;
|
||||||
return new MaterialItem(gamedef, nodename, count);
|
return new MaterialItem(gamedef, nodename, count);
|
||||||
}
|
}
|
||||||
else if(name == "MBOItem")
|
else if(name == "MBOItem")
|
||||||
@ -140,6 +142,8 @@ InventoryItem* InventoryItem::deSerialize(std::istream &is, IGameDef *gamedef)
|
|||||||
// Then read count
|
// Then read count
|
||||||
fnd.skip_over(" ");
|
fnd.skip_over(" ");
|
||||||
u16 count = stoi(trim(fnd.next("")));
|
u16 count = stoi(trim(fnd.next("")));
|
||||||
|
if(count == 0)
|
||||||
|
count = 1;
|
||||||
return new CraftItem(gamedef, subname, count);
|
return new CraftItem(gamedef, subname, count);
|
||||||
}
|
}
|
||||||
else if(name == "ToolItem")
|
else if(name == "ToolItem")
|
||||||
|
Loading…
Reference in New Issue
Block a user