diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-11-14 00:19:48 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-11-29 19:13:41 +0200 |
commit | abceeee92f99b84ebb79968269835a4f509bfb90 (patch) | |
tree | 669edeca68fae4eb086ac4e4c1846b55d3aa779d /src/clientobject.cpp | |
parent | 5fc791ac9a15ea6f234ca2d23041c83679255746 (diff) | |
download | minetest-abceeee92f99b84ebb79968269835a4f509bfb90.tar.gz minetest-abceeee92f99b84ebb79968269835a4f509bfb90.tar.bz2 minetest-abceeee92f99b84ebb79968269835a4f509bfb90.zip |
Create framework for getting rid of global definitions of node/tool/item/whatever types
Diffstat (limited to 'src/clientobject.cpp')
-rw-r--r-- | src/clientobject.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/clientobject.cpp b/src/clientobject.cpp index ee2ad0b9f..7dec1903e 100644 --- a/src/clientobject.cpp +++ b/src/clientobject.cpp @@ -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; } |