diff engine/core/model/structures/layer.cpp @ 91:e7b55b2b398f

Corrected Layer::addInstance() to return appropriate bool. Added the function to layer.i for swig
author Sleek@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 19 Jul 2008 12:14:51 +0000
parents 9855464762c1
children 746df66978da
line wrap: on
line diff
--- a/engine/core/model/structures/layer.cpp	Sat Jul 19 12:06:14 2008 +0000
+++ b/engine/core/model/structures/layer.cpp	Sat Jul 19 12:14:51 2008 +0000
@@ -63,7 +63,7 @@
 		return createInstance(object, emc, id);	
 	}
 
-	Instance* Layer::createInstance(Object* object, const ExactModelCoordinate& p, const std::string& id) {
+	bool Layer::createInstance(Object* object, const ExactModelCoordinate& p, const std::string& id) {
 		Location l;
 		l.setLayer(this);
 		l.setExactLayerCoordinates(p);
@@ -90,8 +90,11 @@
 	}
 	
 	bool Layer::addInstance(Instance* instance, const ExactModelCoordinate& p){
-        if( !instance )
+        if( !instance ){
             FL_ERR(_log, "Tried to add an instance to layer, but given instance is invalid");
+            return false;
+        }
+        
 	    Location l;
 		l.setLayer(this);
 		l.setExactLayerCoordinates(p);
@@ -114,7 +117,7 @@
 			++i;
 		}
 		m_changed = true;
-		return instance;
+		return true;
 	}
 	
 	void Layer::deleteInstance(Instance* instance) {