From b329e5045df0d9ac08bc9dbfeda9003369d3442b Mon Sep 17 00:00:00 2001 From: darkrose Date: Thu, 23 Oct 2014 16:48:15 +1000 Subject: [PATCH] convert old creatures mobs to new ones --- src/serverobject.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/serverobject.cpp b/src/serverobject.cpp index 29c53d2..4994669 100644 --- a/src/serverobject.cpp +++ b/src/serverobject.cpp @@ -24,6 +24,8 @@ ************************************************************************/ #include "serverobject.h" +#include "content_object.h" +#include "content_sao.h" #include #include "inventory.h" @@ -51,6 +53,21 @@ ServerActiveObject* ServerActiveObject::create(u8 type, core::map::Node *n; n = m_types.find(type); if (n == NULL) { + // convert old creatures to new + switch (type) { + case ACTIVEOBJECT_TYPE_RAT: + return new MobSAO(env,id,pos,CONTENT_MOB_RAT); + break; + case ACTIVEOBJECT_TYPE_OERKKI1: + return new MobSAO(env,id,pos,CONTENT_MOB_OERKKI); + break; + case ACTIVEOBJECT_TYPE_FIREFLY: + return new MobSAO(env,id,pos,CONTENT_MOB_FIREFLY); + break; + case ACTIVEOBJECT_TYPE_MOBV2: + return new MobSAO(env,id,pos,CONTENT_MOB_DUNGEON_MASTER); + break; + } // If factory is not found, just return. dstream<<"WARNING: ServerActiveObject: No factory for type=" <