Skip to content

Commit

Permalink
Ignore old entities from 0.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekdohibs committed Feb 17, 2015
1 parent 54487b3 commit 24315db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/activeobject.h
Expand Up @@ -26,12 +26,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
enum ActiveObjectType {
ACTIVEOBJECT_TYPE_INVALID = 0,
ACTIVEOBJECT_TYPE_TEST = 1,
// Deprecated stuff
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,
// End deprecated stuff
ACTIVEOBJECT_TYPE_LUAENTITY = 7,
// Special type, not stored as a static object
ACTIVEOBJECT_TYPE_PLAYER = 100,
Expand Down
5 changes: 5 additions & 0 deletions src/serverobject.cpp
Expand Up @@ -46,6 +46,11 @@ ServerActiveObject* ServerActiveObject::create(ActiveObjectType type,
std::map<u16, Factory>::iterator n;
n = m_types.find(type);
if(n == m_types.end()) {
// These are 0.3 entity types, return without error.
if (ACTIVEOBJECT_TYPE_ITEM <= type && type <= ACTIVEOBJECT_TYPE_MOBV2) {
return NULL;
}

// If factory is not found, just return.
dstream<<"WARNING: ServerActiveObject: No factory for type="
<<type<<std::endl;
Expand Down

0 comments on commit 24315db

Please sign in to comment.