From f15670379da5529d38936d0a87a50b0dc72c6e8f Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 24 Dec 2010 03:08:05 +0200 Subject: base stuff for item->object conversion --- src/inventory.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/inventory.cpp') diff --git a/src/inventory.cpp b/src/inventory.cpp index 073477dde..332f9d999 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -66,6 +66,14 @@ InventoryItem* InventoryItem::deSerialize(std::istream &is) std::getline(is, inventorystring, '|'); return new MapBlockObjectItem(inventorystring); } + else if(name == "ToolItem") + { + std::string toolname; + std::getline(is, toolname, ' '); + u16 wear; + is>>wear; + return new ToolItem(toolname, wear); + } else { dstream<<"Unknown InventoryItem name=\""<