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

@ -38,7 +38,7 @@ ClientActiveObject::~ClientActiveObject()
removeFromScene(true);
}
ClientActiveObject* ClientActiveObject::create(ActiveObjectType type,
std::unique_ptr<ClientActiveObject> ClientActiveObject::create(ActiveObjectType type,
Client *client, ClientEnvironment *env)
{
// Find factory function
@ -47,11 +47,11 @@ ClientActiveObject* ClientActiveObject::create(ActiveObjectType type,
// If factory is not found, just return.
warningstream << "ClientActiveObject: No factory for type="
<< (int)type << std::endl;
return NULL;
return nullptr;
}
Factory f = n->second;
ClientActiveObject *object = (*f)(client, env);
std::unique_ptr<ClientActiveObject> object = (*f)(client, env);
return object;
}