src/ldtypes.cpp

changeset 306
fef00a6cbff0
parent 286
7a562bf3d829
child 307
c731a22899a3
--- a/src/ldtypes.cpp	Thu Jun 27 12:29:54 2013 +0300
+++ b/src/ldtypes.cpp	Thu Jun 27 14:12:12 2013 +0300
@@ -55,6 +55,9 @@
 	"error",
 };
 
+// List of all LDObjects
+vector<LDObject*> g_LDObjects;
+
 // =============================================================================
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
@@ -65,6 +68,14 @@
 	m_hidden = false;
 	m_selected = false;
 	m_glinit = false;
+	
+	// Determine ID
+	int id = 1; // 0 is invalid
+	for( LDObject* obj : g_LDObjects )
+		if( obj->id() >= id )
+			id = obj->id() + 1;
+	
+	setID( id );
 }
 
 LDGibberish::LDGibberish () {}

mercurial