Skip to content

Instantly share code, notes, and snippets.

@Ekdohibs
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ekdohibs/bc9fc6fde97f387f851a to your computer and use it in GitHub Desktop.
Save Ekdohibs/bc9fc6fde97f387f851a to your computer and use it in GitHub Desktop.
commit 082787c1377478fb1852eb3e9ef58d08cea00d70
Author: Novatux <nathanael.courant@laposte.net>
Date: Tue Feb 17 15:01:54 2015 +0100
Ignore old entities from 0.3.
diff --git a/src/activeobject.h b/src/activeobject.h
index 7689328..48f078d 100644
--- a/src/activeobject.h
+++ b/src/activeobject.h
@@ -26,12 +26,13 @@
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,
diff --git a/src/serverobject.cpp b/src/serverobject.cpp
index 98d8255..9cf8178 100644
--- a/src/serverobject.cpp
+++ b/src/serverobject.cpp
@@ -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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment