From 2c860a6a420e16289c56f6185f333a2dd0cde386 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Fri, 9 Mar 2018 08:25:48 +0100 Subject: 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 --- src/staticobject.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/staticobject.cpp') 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) { -- cgit v1.2.3