BGE Bugfix, lights were not being removed when their gameobject was removed causing...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 28 Aug 2008 07:03:23 +0000 (07:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 28 Aug 2008 07:03:23 +0000 (07:03 +0000)
source/gameengine/Ketsji/KX_Scene.cpp

index ab3692d2411b1402a760ea45731e3888bcac6076..e0a7ebb542311e07f24b68a2b8425c592404d679 100644 (file)
@@ -944,6 +944,8 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj)
        
        newobj->RemoveMeshes();
        ret = 1;
        
        newobj->RemoveMeshes();
        ret = 1;
+       if (newobj->IsLight() && m_lightlist->RemoveValue(newobj))
+               ret = newobj->Release();
        if (m_objectlist->RemoveValue(newobj))
                ret = newobj->Release();
        if (m_tempObjectList->RemoveValue(newobj))
        if (m_objectlist->RemoveValue(newobj))
                ret = newobj->Release();
        if (m_tempObjectList->RemoveValue(newobj))