Ignore old entities from 0.3.
authorNovatux <nathanael.courant@laposte.net>
Tue, 17 Feb 2015 14:01:54 +0000 (15:01 +0100)
committerNovatux <nathanael.courant@laposte.net>
Tue, 17 Feb 2015 14:07:05 +0000 (15:07 +0100)
src/activeobject.h
src/serverobject.cpp

index 76893280a5a504831af04e04122f0022cffa8eaf..48f078d3f28183faf37b8a97e157b19667e07b15 100644 (file)
@@ -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,
index 98d82550fb7c574dac09cc6b3a068755e58166a6..9cf817859a855d0a1656dc29eff219d98f16c2df 100644 (file)
@@ -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;