summaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-16 22:47:37 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:48 +0200
commit8dd3622c6d3c85adbb293eacf61f76c1118c9255 (patch)
tree70422f67bdad21924b27a5c6d9a6260fa4c77e7a /src/inventory.h
parent564c3a9c960e84b69502540d39fcc056fcd4bdf7 (diff)
downloadminetest-8dd3622c6d3c85adbb293eacf61f76c1118c9255.tar.gz
minetest-8dd3622c6d3c85adbb293eacf61f76c1118c9255.tar.bz2
minetest-8dd3622c6d3c85adbb293eacf61f76c1118c9255.zip
Improve item serialization
Diffstat (limited to 'src/inventory.h')
-rw-r--r--src/inventory.h23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/inventory.h b/src/inventory.h
index 64fab921b..9c6a967a2 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -139,22 +139,11 @@ public:
}
virtual void serialize(std::ostream &os) const
{
- std::string nodename = m_nodename;
- if(nodename == "")
- nodename = "unknown_block";
-
- os<<"MaterialItem3";
+ os<<"NodeItem";
os<<" \"";
- os<<nodename;
+ os<<m_nodename;
os<<"\" ";
os<<m_count;
-
- // Old
- /*os<<"MaterialItem2";
- os<<" ";
- os<<(unsigned int)m_content;
- os<<" ";
- os<<m_count;*/
}
virtual InventoryItem* clone()
{
@@ -225,9 +214,9 @@ public:
virtual void serialize(std::ostream &os) const
{
os<<getName();
- os<<" ";
+ os<<" \"";
os<<m_subname;
- os<<" ";
+ os<<"\" ";
os<<m_count;
}
virtual InventoryItem* clone()
@@ -304,9 +293,9 @@ public:
virtual void serialize(std::ostream &os) const
{
os<<getName();
- os<<" ";
+ os<<" \"";
os<<m_toolname;
- os<<" ";
+ os<<"\" ";
os<<m_wear;
}
virtual InventoryItem* clone()