X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fclientobject.cpp;h=f4b69201ba9ad6fc38240995d7e0d388fdcf951f;hb=f4fedfed070ffd85c3446bc5d38d2fbd577640d6;hp=e7c735dac03d2ce95e42296c2b77494cafc2636a;hpb=22e186b4aa88b585e71500c4e9a03bf69b0b6191;p=dragonfireclient.git diff --git a/src/clientobject.cpp b/src/clientobject.cpp index e7c735dac..f4b69201b 100644 --- a/src/clientobject.cpp +++ b/src/clientobject.cpp @@ -20,16 +20,15 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "clientobject.h" #include "debug.h" #include "porting.h" -#include "constants.h" /* ClientActiveObject */ -ClientActiveObject::ClientActiveObject(u16 id, IGameDef *gamedef, +ClientActiveObject::ClientActiveObject(u16 id, Client *client, ClientEnvironment *env): ActiveObject(id), - m_gamedef(gamedef), + m_client(client), m_env(env) { } @@ -39,32 +38,29 @@ ClientActiveObject::~ClientActiveObject() removeFromScene(true); } -ClientActiveObject* ClientActiveObject::create(u8 type, IGameDef *gamedef, - ClientEnvironment *env) +ClientActiveObject* ClientActiveObject::create(ActiveObjectType type, + Client *client, ClientEnvironment *env) { // Find factory function - core::map::Node *n; - n = m_types.find(type); - if(n == NULL) - { + auto n = m_types.find(type); + if (n == m_types.end()) { // If factory is not found, just return. - dstream<<"WARNING: ClientActiveObject: No factory for type=" - <<(int)type<