diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2020-04-11 11:22:15 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2020-04-11 16:07:17 +0200 |
commit | 5146086a64d5eeb480948d612a008a2ec81455d4 (patch) | |
tree | 924bc1191cd251cd48d7f41e7d9b02577985eadf /src/server/serveractiveobject.cpp | |
parent | 894a34aef48024a752a1ef151d046955d83858d0 (diff) | |
download | minetest-5146086a64d5eeb480948d612a008a2ec81455d4.tar.gz minetest-5146086a64d5eeb480948d612a008a2ec81455d4.tar.bz2 minetest-5146086a64d5eeb480948d612a008a2ec81455d4.zip |
Drop content_sao.{cpp,h}
Move LuaEntitySAO to a new dedicated file
Drop TestSAO (useless object)
Drop the old static startup initialized SAO factory, which was pretty useless.
This factory was using a std::map for 2 elements, now just use a simple condition owned by ServerEnvironment, which will be lightweight, that will also drop a one time useful test on each LuaEntitySAO creation. This should reduce server load on massive SAO creation
Diffstat (limited to 'src/server/serveractiveobject.cpp')
-rw-r--r-- | src/server/serveractiveobject.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/server/serveractiveobject.cpp b/src/server/serveractiveobject.cpp index 3aa78c7d5..8345ebd47 100644 --- a/src/server/serveractiveobject.cpp +++ b/src/server/serveractiveobject.cpp @@ -30,39 +30,6 @@ ServerActiveObject::ServerActiveObject(ServerEnvironment *env, v3f pos): { } -ServerActiveObject* ServerActiveObject::create(ActiveObjectType type, - ServerEnvironment *env, u16 id, v3f pos, - const std::string &data) -{ - // Find factory function - 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. - warningstream<<"ServerActiveObject: No factory for type=" - <<type<<std::endl; - return NULL; - } - - Factory f = n->second; - ServerActiveObject *object = (*f)(env, pos, data); - return object; -} - -void ServerActiveObject::registerType(u16 type, Factory f) -{ - std::map<u16, Factory>::iterator n; - n = m_types.find(type); - if(n != m_types.end()) - return; - m_types[type] = f; -} - float ServerActiveObject::getMinimumSavedMovement() { return 2.0*BS; |