convert old creatures mobs to new ones

This commit is contained in:
darkrose 2014-10-23 16:48:15 +10:00
parent cb692e6f73
commit b329e5045d
1 changed files with 17 additions and 0 deletions

View File

@ -24,6 +24,8 @@
************************************************************************/
#include "serverobject.h"
#include "content_object.h"
#include "content_sao.h"
#include <fstream>
#include "inventory.h"
@ -51,6 +53,21 @@ ServerActiveObject* ServerActiveObject::create(u8 type,
core::map<u16, Factory>::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="
<<type<<std::endl;