]> git.lizzy.rs Git - minetest.git/blobdiff - src/staticobject.cpp
GUIHyperText: Fix bug with UTF8 chars in action name + simplify UTF8 stringw conversi...
[minetest.git] / src / staticobject.cpp
index 6ad2e1f940f64bea30c71df828a352049b52db13..bebca12ecabe0b48e4ae2c2d1e7d33481c592031 100644 (file)
@@ -19,7 +19,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "staticobject.h"
 #include "util/serialize.h"
-#include "log.h"
+#include "content_sao.h"
+
+StaticObject::StaticObject(const ServerActiveObject *s_obj, const v3f &pos_):
+       type(s_obj->getType()),
+       pos(pos_)
+{
+       s_obj->getStaticData(&data);
+}
 
 void StaticObject::serialize(std::ostream &os)
 {
@@ -70,6 +77,15 @@ void StaticObjectList::serialize(std::ostream &os)
 }
 void StaticObjectList::deSerialize(std::istream &is)
 {
+       if (m_active.size()) {
+               errorstream << "StaticObjectList::deSerialize(): "
+                       << "deserializing objects while " << m_active.size()
+                       << " active objects already exist (not cleared). "
+                       << m_stored.size() << " stored objects _were_ cleared"
+                       << std::endl;
+       }
+       m_stored.clear();
+
        // version
        u8 version = readU8(is);
        // count