From e6e3eef0ef0873b5853b6d055cea0f2b812c65c8 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Thu, 1 Dec 2011 13:22:33 +0200 Subject: Add ServerActiveObject::removingFromEnvironment() --- src/environment.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/environment.cpp') diff --git a/src/environment.cpp b/src/environment.cpp index 9748f6b71..81021ad83 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -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="<removingFromEnvironment(); // Deregister in scripting api scriptapi_rm_object_reference(m_lua, obj); -- cgit v1.2.3