1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00: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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 204 additions and 153 deletions

View file

@ -199,7 +199,7 @@ public:
return ACTIVEOBJECT_TYPE_TEST;
}
static ClientActiveObject* create(Client *client, ClientEnvironment *env);
static std::unique_ptr<ClientActiveObject> create(Client *client, ClientEnvironment *env);
void addToScene(ITextureSource *tsrc, scene::ISceneManager *smgr);
void removeFromScene(bool permanent);
@ -227,9 +227,9 @@ TestCAO::TestCAO(Client *client, ClientEnvironment *env):
ClientActiveObject::registerType(getType(), create);
}
ClientActiveObject* TestCAO::create(Client *client, ClientEnvironment *env)
std::unique_ptr<ClientActiveObject> TestCAO::create(Client *client, ClientEnvironment *env)
{
return new TestCAO(client, env);
return std::make_unique<TestCAO>(client, env);
}
void TestCAO::addToScene(ITextureSource *tsrc, scene::ISceneManager *smgr)
@ -326,7 +326,7 @@ void TestCAO::processMessage(const std::string &data)
GenericCAO::GenericCAO(Client *client, ClientEnvironment *env):
ClientActiveObject(0, client, env)
{
if (client == NULL) {
if (!client) {
ClientActiveObject::registerType(getType(), create);
} else {
m_client = client;