summaryrefslogtreecommitdiff
path: root/src/staticobject.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2018-03-09 08:25:48 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-03-09 23:27:26 +0100
commit2c860a6a420e16289c56f6185f333a2dd0cde386 (patch)
treea7cf1cafcc95703480f1f475c775fe57a53d35f5 /src/staticobject.cpp
parentdef46c6cdb73c98b6bc73d5a4655b95e8442ce2f (diff)
downloadminetest-2c860a6a420e16289c56f6185f333a2dd0cde386.tar.gz
minetest-2c860a6a420e16289c56f6185f333a2dd0cde386.tar.bz2
minetest-2c860a6a420e16289c56f6185f333a2dd0cde386.zip
ServerEnvironment & StaticObject cleanups
* isFreeServerActiveObjectId is now part of ServerEnvironment * getFreeServerActiveObjectId is now part of ServerEnvironment * StaticObject constructor now take ServerActiveObject instead of type + string. This permits to remove a big string copy in some code parts
Diffstat (limited to 'src/staticobject.cpp')
-rw-r--r--src/staticobject.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/staticobject.cpp b/src/staticobject.cpp
index 6ad2e1f94..b331ac2f2 100644
--- a/src/staticobject.cpp
+++ b/src/staticobject.cpp
@@ -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)
{