Skip to content

Commit 24315db

Browse files
committedFeb 17, 2015
Ignore old entities from 0.3.
1 parent 54487b3 commit 24315db

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

Diff for: ‎src/activeobject.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2626
enum ActiveObjectType {
2727
ACTIVEOBJECT_TYPE_INVALID = 0,
2828
ACTIVEOBJECT_TYPE_TEST = 1,
29+
// Deprecated stuff
2930
ACTIVEOBJECT_TYPE_ITEM = 2,
30-
// Compat layer, migrating objects from 0.3 to 0.4+
3131
ACTIVEOBJECT_TYPE_RAT = 3,
3232
ACTIVEOBJECT_TYPE_OERKKI1 = 4,
3333
ACTIVEOBJECT_TYPE_FIREFLY = 5,
3434
ACTIVEOBJECT_TYPE_MOBV2 = 6,
35+
// End deprecated stuff
3536
ACTIVEOBJECT_TYPE_LUAENTITY = 7,
3637
// Special type, not stored as a static object
3738
ACTIVEOBJECT_TYPE_PLAYER = 100,

Diff for: ‎src/serverobject.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ ServerActiveObject* ServerActiveObject::create(ActiveObjectType type,
4646
std::map<u16, Factory>::iterator n;
4747
n = m_types.find(type);
4848
if(n == m_types.end()) {
49+
// These are 0.3 entity types, return without error.
50+
if (ACTIVEOBJECT_TYPE_ITEM <= type && type <= ACTIVEOBJECT_TYPE_MOBV2) {
51+
return NULL;
52+
}
53+
4954
// If factory is not found, just return.
5055
dstream<<"WARNING: ServerActiveObject: No factory for type="
5156
<<type<<std::endl;

0 commit comments

Comments
 (0)
Please sign in to comment.