1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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
This commit is contained in:
Loic Blot 2018-03-09 08:25:48 +01:00 committed by Loïc Blot
parent def46c6cdb
commit 2c860a6a42
4 changed files with 48 additions and 30 deletions

View file

@ -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);