Skip to content

Instantly share code, notes, and snippets.

@Ekdohibs
Created February 17, 2015 11:13
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/96c101940500dde6520e to your computer and use it in GitHub Desktop.
Save Ekdohibs/96c101940500dde6520e to your computer and use it in GitHub Desktop.
commit b4373e3d749760a592d11316d843fb087d10ad46
Author: Novatux <nathanael.courant@laposte.net>
Date: Tue Feb 17 12:11:34 2015 +0100
Remove old entities from 0.3, and silence their errror messages.
diff --git a/src/activeobject.h b/src/activeobject.h
index 7689328..ad3f199 100644
--- a/src/activeobject.h
+++ b/src/activeobject.h
@@ -26,12 +26,7 @@
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,
+// Types from 2 to 6 should not be used, they were used in 0.3 and now deprecated
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..fd23480 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 (2 <= type && type <= 6) {
+ 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