diff options
author | Perttu Ahola <celeron55@gmail.com> | 2010-12-24 03:08:05 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2010-12-24 03:08:05 +0200 |
commit | f15670379da5529d38936d0a87a50b0dc72c6e8f (patch) | |
tree | 990b86539386bbe4122b530a6367c60f223e55d0 /src/inventory.cpp | |
parent | 10b06419ab454e8931a9b6502029bc298e8bce35 (diff) | |
download | minetest-f15670379da5529d38936d0a87a50b0dc72c6e8f.tar.gz minetest-f15670379da5529d38936d0a87a50b0dc72c6e8f.tar.bz2 minetest-f15670379da5529d38936d0a87a50b0dc72c6e8f.zip |
base stuff for item->object conversion
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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=\""<<name<<"\""<<std::endl; @@ -126,6 +134,19 @@ MapBlockObject * MapBlockObjectItem::createObject RatObject *obj = new RatObject(NULL, -1, pos); return obj; } + else if(name == "ItemObj") + { + /* + Now we are an inventory item containing the serialization + string of an object that contains the serialization + string of an inventory item. Fuck this. + */ + //assert(0); + dstream<<__FUNCTION_NAME<<": WARNING: Ignoring ItemObj " + <<"because an item-object should never be inside " + <<"an object-item."<<std::endl; + return NULL; + } else { return NULL; |