From abceeee92f99b84ebb79968269835a4f509bfb90 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 14 Nov 2011 00:19:48 +0200 Subject: Create framework for getting rid of global definitions of node/tool/item/whatever types --- src/clientobject.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/clientobject.cpp') 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::Node *n; @@ -50,7 +51,7 @@ ClientActiveObject* ClientActiveObject::create(u8 type) } Factory f = n->getValue(); - ClientActiveObject *object = (*f)(); + ClientActiveObject *object = (*f)(gamedef); return object; } -- cgit v1.2.3