summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-10-15 02:28:57 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-10-15 02:28:57 +0300
commit43a28f04fa3ddf4b612f58c25a896293a01567e3 (patch)
tree58ca2cac232c28ffd59609ad3998b97628f13e33 /src/inventory.cpp
parent080002f8ed1af6d34cdc6f5abff0f51586ca831c (diff)
downloadminetest-43a28f04fa3ddf4b612f58c25a896293a01567e3.tar.gz
minetest-43a28f04fa3ddf4b612f58c25a896293a01567e3.tar.bz2
minetest-43a28f04fa3ddf4b612f58c25a896293a01567e3.zip
mobv2
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp73
1 files changed, 1 insertions, 72 deletions
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")
{
@@ -220,77 +220,6 @@ bool CraftItem::use(ServerEnvironment *env, Player *player)
}
/*
- 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."<<std::endl;
- return NULL;
- }
- else
- {
- return NULL;
- }
-}
-
-/*
Inventory
*/