1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add ServerActiveObject::removingFromEnvironment()

This commit is contained in:
Perttu Ahola 2011-12-01 13:22:33 +02:00
parent 0e113a4c81
commit e6e3eef0ef
3 changed files with 17 additions and 6 deletions

View file

@ -741,8 +741,12 @@ void ServerEnvironment::clearAllObjects()
obj->m_removed = true;
continue;
}
// Tell the object about removal
obj->removingFromEnvironment();
// Deregister in scripting api
scriptapi_rm_object_reference(m_lua, obj);
// Delete active object
delete obj;
// Id to be removed from m_active_objects
@ -1395,6 +1399,8 @@ void ServerEnvironment::removeRemovedObjects()
if(obj->m_known_by_count > 0)
continue;
// Tell the object about removal
obj->removingFromEnvironment();
// Deregister in scripting api
scriptapi_rm_object_reference(m_lua, obj);
@ -1680,6 +1686,8 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
<<"object id="<<id<<" is not known by clients"
<<"; deleting"<<std::endl;
// Tell the object about removal
obj->removingFromEnvironment();
// Deregister in scripting api
scriptapi_rm_object_reference(m_lua, obj);