]> git.lizzy.rs Git - minetest.git/blobdiff - src/object_properties.cpp
Create PacketError exception and use it with ACTIVEOBJECT_REMOVE_ADD handler which...
[minetest.git] / src / object_properties.cpp
index 1602f03f20312faff3873cb3919b333f89b961a4..f560f59343a6d6507e6993d8b2aaacb43c84b2af 100644 (file)
@@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "object_properties.h"
 #include "irrlichttypes_bloated.h"
+#include "exceptions.h"
 #include "util/serialize.h"
 #include <sstream>
-#include <map>
 
 #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
 #define PP2(x) "("<<(x).X<<","<<(x).Y<<")"
@@ -40,7 +40,9 @@ ObjectProperties::ObjectProperties():
        is_visible(true),
        makes_footstep_sound(false),
        automatic_rotate(0),
-       stepheight(0)
+       stepheight(0),
+       automatic_face_movement_dir(false),
+       automatic_face_movement_dir_offset(0.0)
 {
        textures.push_back("unknown_object.png");
        colors.push_back(video::SColor(255,255,255,255));
@@ -102,6 +104,8 @@ void ObjectProperties::serialize(std::ostream &os) const
        }
        writeU8(os, collideWithObjects);
        writeF1000(os,stepheight);
+       writeU8(os, automatic_face_movement_dir);
+       writeF1000(os, automatic_face_movement_dir_offset);
        // Add stuff only at the bottom.
        // Never remove anything, because we don't want new versions of this
 }
@@ -136,6 +140,8 @@ void ObjectProperties::deSerialize(std::istream &is)
                        }
                        collideWithObjects = readU8(is);
                        stepheight = readF1000(is);
+                       automatic_face_movement_dir = readU8(is);
+                       automatic_face_movement_dir_offset = readF1000(is);
                }catch(SerializationError &e){}
        }
        else