summaryrefslogtreecommitdiff
path: root/src/staticobject.h
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.h
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.h')
-rw-r--r--src/staticobject.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/staticobject.h b/src/staticobject.h
index 43f542632..6fb486193 100644
--- a/src/staticobject.h
+++ b/src/staticobject.h
@@ -26,6 +26,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <map>
#include "debug.h"
+class ServerActiveObject;
+
struct StaticObject
{
u8 type = 0;
@@ -33,12 +35,7 @@ struct StaticObject
std::string data;
StaticObject() = default;
- StaticObject(u8 type_, const v3f &pos_, const std::string &data_):
- type(type_),
- pos(pos_),
- data(data_)
- {
- }
+ StaticObject(const ServerActiveObject *s_obj, const v3f &pos_);
void serialize(std::ostream &os);
void deSerialize(std::istream &is, u8 version);