1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02:00

ActiveObjectMgr fixes (#13560)

This commit is contained in:
DS
2023-10-09 17:13:04 +02:00
committed by GitHub
parent 929a13a9a0
commit 11ec75c2ad
17 changed files with 204 additions and 153 deletions

View File

@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irrlichttypes_extrabloated.h"
#include "activeobject.h"
#include <memory>
#include <unordered_map>
#include <unordered_set>
@@ -78,8 +79,8 @@ public:
virtual void initialize(const std::string &data) {}
// Create a certain type of ClientActiveObject
static ClientActiveObject *create(ActiveObjectType type, Client *client,
ClientEnvironment *env);
static std::unique_ptr<ClientActiveObject> create(ActiveObjectType type,
Client *client, ClientEnvironment *env);
// If returns true, punch will not be sent to the server
virtual bool directReportPunch(v3f dir, const ItemStack *punchitem = nullptr,
@@ -87,7 +88,7 @@ public:
protected:
// Used for creating objects based on type
typedef ClientActiveObject *(*Factory)(Client *client, ClientEnvironment *env);
typedef std::unique_ptr<ClientActiveObject> (*Factory)(Client *client, ClientEnvironment *env);
static void registerType(u16 type, Factory f);
Client *m_client;
ClientEnvironment *m_env;