[Orxonox-commit 4632] r9303 - in code/branches/presentation2012merge: data/levels/templates src/libraries/core

landauf at orxonox.net landauf at orxonox.net
Sun Jun 17 18:38:15 CEST 2012


Author: landauf
Date: 2012-06-17 18:38:14 +0200 (Sun, 17 Jun 2012)
New Revision: 9303

Modified:
   code/branches/presentation2012merge/data/levels/templates/pickupRepresentationTemplates.oxt
   code/branches/presentation2012merge/src/libraries/core/Template.cc
Log:
added warning if a template is used on a different type than it was defined for. this doesn't matter technically, but it's misleading.
fixed template type of ShrinkPickups

Modified: code/branches/presentation2012merge/data/levels/templates/pickupRepresentationTemplates.oxt
===================================================================
--- code/branches/presentation2012merge/data/levels/templates/pickupRepresentationTemplates.oxt	2012-06-17 16:24:06 UTC (rev 9302)
+++ code/branches/presentation2012merge/data/levels/templates/pickupRepresentationTemplates.oxt	2012-06-17 16:38:14 UTC (rev 9303)
@@ -490,7 +490,7 @@
 </Template>
 
 <Template name=smallshrinkpickup>
-  <InvisiblePickup 
+  <ShrinkPickup 
     duration = 10.0
     shrinkFactor = 2.5
     activaionType = "immediate"
@@ -515,7 +515,7 @@
 </Template>
 
 <Template name=mediumshrinkpickup>
-  <InvisiblePickup 
+  <ShrinkPickup 
     duration = 30.0
     shrinkFactor = 5.0
     activaionType = "immediate"
@@ -540,7 +540,7 @@
 </Template>
 
 <Template name=hugeshrinkpickup>
-  <InvisiblePickup 
+  <ShrinkPickup 
     duration = 60.0
     shrinkFactor = 10.0
     activaionType = "immediate"

Modified: code/branches/presentation2012merge/src/libraries/core/Template.cc
===================================================================
--- code/branches/presentation2012merge/src/libraries/core/Template.cc	2012-06-17 16:24:06 UTC (rev 9302)
+++ code/branches/presentation2012merge/src/libraries/core/Template.cc	2012-06-17 16:38:14 UTC (rev 9303)
@@ -148,6 +148,11 @@
 
         orxout(verbose, context::templates) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << endl;
 
+        // check if the template is applied on an object of the right type
+        Identifier* identifier = Identifier::getIdentifierByString(this->getXMLElement().Value());
+        if (!object->getIdentifier()->isA(identifier))
+            orxout(internal_warning, context::templates) << "Template was defined for " << identifier->getName() << " but the object is of type " << object->getIdentifier()->getName() << endl;
+
         Element temp = &const_cast<TiXmlElement&>(this->getXMLElement());
 
         if (this->bLoadDefaults_)




More information about the Orxonox-commit mailing list