mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Create framework for getting rid of global definitions of node/tool/item/whatever types
This commit is contained in:
parent
5fc791ac9a
commit
abceeee92f
60 changed files with 1017 additions and 743 deletions
|
@ -26,8 +26,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
ClientActiveObject
|
||||
*/
|
||||
|
||||
ClientActiveObject::ClientActiveObject(u16 id):
|
||||
ActiveObject(id)
|
||||
ClientActiveObject::ClientActiveObject(u16 id, IGameDef *gamedef):
|
||||
ActiveObject(id),
|
||||
m_gamedef(gamedef)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -36,7 +37,7 @@ ClientActiveObject::~ClientActiveObject()
|
|||
removeFromScene();
|
||||
}
|
||||
|
||||
ClientActiveObject* ClientActiveObject::create(u8 type)
|
||||
ClientActiveObject* ClientActiveObject::create(u8 type, IGameDef *gamedef)
|
||||
{
|
||||
// Find factory function
|
||||
core::map<u16, Factory>::Node *n;
|
||||
|
@ -50,7 +51,7 @@ ClientActiveObject* ClientActiveObject::create(u8 type)
|
|||
}
|
||||
|
||||
Factory f = n->getValue();
|
||||
ClientActiveObject *object = (*f)();
|
||||
ClientActiveObject *object = (*f)(gamedef);
|
||||
return object;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue