From c58d49977da5aab88f5a9d5b540c6237ca5cdcb5 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Tue, 17 Feb 2015 11:37:55 +0100 Subject: SAO: re-add old ActiveObjectTypes for a future migration layer --- src/activeobject.h | 5 +++++ src/clientobject.cpp | 7 +++---- src/clientobject.h | 2 +- src/environment.cpp | 4 ++-- src/serverobject.cpp | 5 ++--- src/serverobject.h | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/activeobject.h b/src/activeobject.h index 3dd1f98f5..76893280a 100644 --- a/src/activeobject.h +++ b/src/activeobject.h @@ -27,6 +27,11 @@ enum ActiveObjectType { ACTIVEOBJECT_TYPE_INVALID = 0, ACTIVEOBJECT_TYPE_TEST = 1, ACTIVEOBJECT_TYPE_ITEM = 2, + // Compat layer, migrating objects from 0.3 to 0.4+ + ACTIVEOBJECT_TYPE_RAT = 3, + ACTIVEOBJECT_TYPE_OERKKI1 = 4, + ACTIVEOBJECT_TYPE_FIREFLY = 5, + ACTIVEOBJECT_TYPE_MOBV2 = 6, ACTIVEOBJECT_TYPE_LUAENTITY = 7, // Special type, not stored as a static object ACTIVEOBJECT_TYPE_PLAYER = 100, diff --git a/src/clientobject.cpp b/src/clientobject.cpp index 37f693c5e..ae1be092f 100644 --- a/src/clientobject.cpp +++ b/src/clientobject.cpp @@ -39,14 +39,13 @@ ClientActiveObject::~ClientActiveObject() removeFromScene(true); } -ClientActiveObject* ClientActiveObject::create(u8 type, IGameDef *gamedef, - ClientEnvironment *env) +ClientActiveObject* ClientActiveObject::create(ActiveObjectType type, + IGameDef *gamedef, ClientEnvironment *env) { // Find factory function std::map::iterator n; n = m_types.find(type); - if(n == m_types.end()) - { + if(n == m_types.end()) { // If factory is not found, just return. dstream<<"WARNING: ClientActiveObject: No factory for type=" <<(int)type<::iterator n; n = m_types.find(type); - if(n == m_types.end()) - { + if(n == m_types.end()) { // If factory is not found, just return. dstream<<"WARNING: ServerActiveObject: No factory for type=" <