void gl_DeleteAllAttachedLights() { TThinkerIterator<AActor> it; AActor * a; ADynamicLight * l; while ((a=it.Next())) { a->dynamiclights.Clear(); } TThinkerIterator<ADynamicLight> it2; l=it2.Next(); while (l) { ADynamicLight * ll = it2.Next(); if (l->owned) l->Destroy(); l=ll; } }