Fixed two typo's in commit 615fd498bc
[oweals/minetest.git] / src / nodemetadata.cpp
index c76ad1f4be4054ee02ab826c8edf8e1367a55fb5..141c779f14e176b40b8774c1e487c6abbdfde15c 100644 (file)
@@ -3,27 +3,28 @@ Minetest-c55
 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+GNU Lesser General Public License for more details.
 
-You should have received a copy of the GNU General Public License along
+You should have received a copy of the GNU Lesser General Public License along
 with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
 #include "nodemetadata.h"
-#include "utility.h"
 #include "exceptions.h"
 #include "gamedef.h"
 #include "inventory.h"
-#include <sstream>
 #include "log.h"
+#include "util/serialize.h"
+#include "constants.h" // MAP_BLOCKSIZE
+#include <sstream>
 
 /*
        NodeMetadata
@@ -31,11 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 NodeMetadata::NodeMetadata(IGameDef *gamedef):
        m_stringvars(),
-       m_inventory(new Inventory(gamedef->idef())),
-       m_inventorydrawspec(""),
-       m_formspec(""),
-       m_infotext(""),
-       m_allow_removal(true)
+       m_inventory(new Inventory(gamedef->idef()))
 {
 }
 
@@ -55,10 +52,6 @@ void NodeMetadata::serialize(std::ostream &os) const
        }
 
        m_inventory->serialize(os);
-       os<<serializeString(m_inventorydrawspec);
-       os<<serializeString(m_formspec);
-       os<<serializeString(m_infotext);
-       writeU8(os, m_allow_removal);
 }
 
 void NodeMetadata::deSerialize(std::istream &is)
@@ -72,20 +65,12 @@ void NodeMetadata::deSerialize(std::istream &is)
        }
 
        m_inventory->deSerialize(is);
-       m_inventorydrawspec = deSerializeString(is);
-       m_formspec = deSerializeString(is);
-       m_infotext = deSerializeString(is);
-       m_allow_removal = readU8(is);
 }
 
 void NodeMetadata::clear()
 {
        m_stringvars.clear();
        m_inventory->clear();
-       m_inventorydrawspec = "";
-       m_formspec = "";
-       m_infotext = "";
-       m_allow_removal = true;
 }
 
 /*