From 43a28f04fa3ddf4b612f58c25a896293a01567e3 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 15 Oct 2011 02:28:57 +0300 Subject: mobv2 --- src/inventory.cpp | 73 +------------------------------------------------------ 1 file changed, 1 insertion(+), 72 deletions(-) (limited to 'src/inventory.cpp') diff --git a/src/inventory.cpp b/src/inventory.cpp index a3e35c92c..b8afbc81f 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -97,7 +97,7 @@ InventoryItem* InventoryItem::deSerialize(std::istream &is) { std::string inventorystring; std::getline(is, inventorystring, '|'); - return new MapBlockObjectItem(inventorystring); + throw SerializationError("MBOItem not supported anymore"); } else if(name == "CraftItem") { @@ -219,77 +219,6 @@ bool CraftItem::use(ServerEnvironment *env, Player *player) return false; } -/* - MapBlockObjectItem DEPRECATED - TODO: Remove -*/ -#ifndef SERVER -video::ITexture * MapBlockObjectItem::getImage() const -{ - if(m_inventorystring.substr(0,3) == "Rat") - return g_texturesource->getTextureRaw("rat.png"); - - if(m_inventorystring.substr(0,4) == "Sign") - return g_texturesource->getTextureRaw("sign.png"); - - return NULL; -} -#endif -std::string MapBlockObjectItem::getText() -{ - if(m_inventorystring.substr(0,3) == "Rat") - return ""; - - if(m_inventorystring.substr(0,4) == "Sign") - return ""; - - return "obj"; -} - -MapBlockObject * MapBlockObjectItem::createObject - (v3f pos, f32 player_yaw, f32 player_pitch) -{ - std::istringstream is(m_inventorystring); - std::string name; - std::getline(is, name, ' '); - - if(name == "None") - { - return NULL; - } - else if(name == "Sign") - { - std::string text; - std::getline(is, text, '|'); - SignObject *obj = new SignObject(NULL, -1, pos); - obj->setText(text); - obj->setYaw(-player_yaw); - return obj; - } - else if(name == "Rat") - { - 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."<