Move tool stuff to tool.{h,cpp}
[oweals/minetest.git] / src / serverobject.cpp
index ce19ea34f10a85d7b46aa1a8038e0dde24b7d777..2a007bda5a7d8e0795cae4524cba6fbbacd01d6a 100644 (file)
@@ -21,8 +21,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <fstream>
 #include "inventory.h"
 
-ServerActiveObject::ServerActiveObject(ServerEnvironment *env, u16 id, v3f pos):
-       ActiveObject(id),
+ServerActiveObject::ServerActiveObject(ServerEnvironment *env, v3f pos):
+       ActiveObject(0),
        m_known_by_count(0),
        m_removed(false),
        m_pending_deactivation(false),
@@ -37,6 +37,11 @@ ServerActiveObject::~ServerActiveObject()
 {
 }
 
+void ServerActiveObject::addedToEnvironment(u16 id)
+{
+       setId(id);
+}
+
 ServerActiveObject* ServerActiveObject::create(u8 type,
                ServerEnvironment *env, u16 id, v3f pos,
                const std::string &data)
@@ -53,7 +58,7 @@ ServerActiveObject* ServerActiveObject::create(u8 type,
        }
 
        Factory f = n->getValue();
-       ServerActiveObject *object = (*f)(env, id, pos, data);
+       ServerActiveObject *object = (*f)(env, pos, data);
        return object;
 }