[Orxonox-commit 7006] r11625 - code/branches/SOBv2_HS17/src/modules/superorxobros

varxth at orxonox.net varxth at orxonox.net
Mon Dec 4 14:45:08 CET 2017


Author: varxth
Date: 2017-12-04 14:45:06 +0100 (Mon, 04 Dec 2017)
New Revision: 11625

Modified:
   code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc
Log:
improvment

Modified: code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc
===================================================================
--- code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc	2017-12-04 13:38:03 UTC (rev 11624)
+++ code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc	2017-12-04 13:45:06 UTC (rev 11625)
@@ -38,6 +38,7 @@
 #include "core/XMLPort.h"
 #include "SOBFigure.h"
 #include "SOBGumba.h"
+#include "SOBGumbaBoss.h"    
 #include "SOB.h"    
 #include "util/Output.h"
 #include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
@@ -105,10 +106,17 @@
         collDisX_ = getPosition().x - contactPoint.getPositionWorldOnB().getX();
         collDisZ_ = getPosition().z - contactPoint.getPositionWorldOnB().getZ();
 
-        SOBGumba* gumba = orxonox_cast<SOBGumba*>(otherObject);
+        SOBGumba*       gumba       = orxonox_cast<SOBGumba*>       (otherObject);
+        SOBGumbaBoss*   gumbaBoss   = orxonox_cast<SOBGumbaBoss*>   (otherObject);
 
+        if(gumbaBoss != nullptr && !(gumba->hasCollided_))
+        {
+            this->destroyLater();
+            this->hasCollided_ = true;
+        }
 
-        if(gumba!=nullptr && !(gumba->hasCollided_)) //if other object is a Gumba, kill the Gumba and add score and destroy the fireball
+
+        if(gumba!=nullptr && gumbaBoss == nullptr && !(gumba->hasCollided_)) //if other object is a Gumba, kill the Gumba and add score and destroy the fireball
         {
             gumba->destroyLater();
             gumba->hasCollided_ = true;



More information about the Orxonox-commit mailing list