[Orxonox-commit 46] r2751 - branches/network/src/orxonox/objects/worldentities

scheusso at orxonox.net scheusso at orxonox.net
Fri Mar 6 14:08:02 CET 2009


Author: scheusso
Date: 2009-03-06 14:08:02 +0100 (Fri, 06 Mar 2009)
New Revision: 2751

Modified:
   branches/network/src/orxonox/objects/worldentities/ExplosionChunk.cc
Log:
(partially) fixed network issues with explosionchunk
the problem that remains: if a client ship gets destroyed, the 
explosions remain and get periodically triggered (probably a timer 
problem)


Modified: branches/network/src/orxonox/objects/worldentities/ExplosionChunk.cc
===================================================================
--- branches/network/src/orxonox/objects/worldentities/ExplosionChunk.cc	2009-03-05 13:58:42 UTC (rev 2750)
+++ branches/network/src/orxonox/objects/worldentities/ExplosionChunk.cc	2009-03-06 13:08:02 UTC (rev 2751)
@@ -46,22 +46,30 @@
     {
         RegisterObject(ExplosionChunk);
 
-        if (!this->getScene() || !Core::showsGraphics() || !this->getScene()->getSceneManager())
+        if ( Core::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
             ThrowException(AbortLoading, "Can't create ExplosionChunk, no scene or no scene manager given.");
 
         this->bStop_ = false;
         this->LOD_ = LODParticle::normal;
 
-        try
+        if ( Core::showsGraphics() )
         {
-            this->fire_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
-            this->attachOgreObject(this->fire_->getParticleSystem());
-            this->smoke_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
-            this->attachOgreObject(this->smoke_->getParticleSystem());
+            try
+            {
+                this->fire_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
+                this->attachOgreObject(this->fire_->getParticleSystem());
+                this->smoke_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
+                this->attachOgreObject(this->smoke_->getParticleSystem());
+            }
+            catch (...)
+            {
+                COUT(1) << "Error: Couln't load particle effect in ExplosionChunk." << std::endl;
+                this->fire_ = 0;
+                this->smoke_ = 0;
+            }
         }
-        catch (...)
+        else
         {
-            COUT(1) << "Error: Couln't load particle effect in ExplosionChunk." << std::endl;
             this->fire_ = 0;
             this->smoke_ = 0;
         }




More information about the Orxonox-commit mailing list