Index: orxonox/trunk/src/lib/graphics/particles/particle_emitter.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/particles/particle_emitter.cc	(revision 4010)
+++ orxonox/trunk/src/lib/graphics/particles/particle_emitter.cc	(revision 4017)
@@ -124,17 +124,20 @@
     // saving the time
     float count = (dt+this->saveTime) * this->emissionRate;
-    this->saveTime = modff(count, &count);
-    this->saveTime /= this->emissionRate;
+    this->saveTime = modff(count, &count) / this->emissionRate;
     PRINTF(5)("emitting %f particles, saving %f seconds for the next round\n", count, this->saveTime); 
     
-    for (int i = 0; i < count; i++)
-      // emmits from EMITTER_DOT,
+    if (likely(count > 0))
       {
-	Vector randDir = Vector(random()-RAND_MAX/2, random()-RAND_MAX/2, random()-RAND_MAX/2);
-	randDir.normalize();
-	randDir = (this->getAbsDir()*Quaternion(angle + randomAngle *((float)random()/RAND_MAX -.5), randDir)).apply(this->direction);
-	randDir = randDir.getNormalized()*velocity + (this->getVelocity() * system->inheritSpeed);
-
-	system->addParticle(this->getAbsCoor(), randDir);
+	Vector inheritVelocity = this->getVelocity() * system->inheritSpeed;
+	for (int i = 0; i < count; i++)
+	  // emmits from EMITTER_DOT,
+	  {
+	    Vector randDir = Vector(rand()-RAND_MAX/2, rand()-RAND_MAX/2, rand()-RAND_MAX/2);
+	    randDir.normalize();
+	    randDir = (this->getAbsDir()*Quaternion(angle + randomAngle *((float)rand()/RAND_MAX -.5), randDir)).apply(this->direction);
+	    Vector velocityV = randDir.getNormalized()*this->velocity + inheritVelocity;
+	    
+	    system->addParticle(this->getAbsCoor(), velocityV);
+	  }
       }
   }
Index: orxonox/trunk/src/lib/graphics/particles/particle_system.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/particles/particle_system.cc	(revision 4010)
+++ orxonox/trunk/src/lib/graphics/particles/particle_system.cc	(revision 4017)
@@ -229,13 +229,13 @@
   glMatrixMode(GL_MODELVIEW);
   //  glDisable(GL_LIGHTING);
-  material->select();
-
-  Particle* drawPart = particles;
+  material->select(); 
+  glDisable(GL_DEPTH_TEST);
+ Particle* drawPart = particles;
   if (likely(drawPart != NULL))
     {
-      glBegin(GL_POINTS);
+      //draw in DOT mode
+      //      glBegin(GL_POINTS);
       while (likely(drawPart != NULL))
 	{
-	  // draw in DOT mode
 	  glPushMatrix();
 	  glTranslatef(drawPart->position.x, drawPart->position.y, drawPart->position.z);
@@ -243,10 +243,12 @@
 	  glCallList(*this->glID);
 	  
-	  //	  	  glVertex3f(drawPart->position.x, drawPart->position.y, drawPart->position.z);
+	  //glVertex3f(drawPart->position.x, drawPart->position.y, drawPart->position.z);
 	  drawPart = drawPart->next;
 	  glPopMatrix();
 	}
-      glEnd();
+      //      glEnd();
     }
+  //  glEnable(GL_LIGHTING);
+  glEnable(GL_DEPTH_TEST);
 }
 
@@ -275,18 +277,18 @@
 	}
       
-      particles->timeToLive = this->lifeSpan + (float)(random()/RAND_MAX)* this->randomLifeSpan;
+      particles->timeToLive = this->lifeSpan + (float)(rand()/RAND_MAX)* this->randomLifeSpan;
       particles->position = position;
       particles->velocity = velocity;
 
       //  particle->rotation = ; //! \todo rotation is once again something to be done.
-      particles->mass = this->initialMass + (random()/RAND_MAX -.5)* this->randomInitialMass;
-      particles->radius = this->startRadius + (random()/RAND_MAX-.5)*this->randomStartRadius;
+      particles->mass = this->initialMass + (rand()/RAND_MAX -.5)* this->randomInitialMass;
+      particles->radius = this->startRadius + (rand()/RAND_MAX-.5)*this->randomStartRadius;
       
-      particles->radiusIt = (this->endRadius + (random()/RAND_MAX-.5)*this->randomEndRadius - particles->radius) / particles->timeToLive;
+      particles->radiusIt = (this->endRadius + (rand()/RAND_MAX-.5)*this->randomEndRadius - particles->radius) / particles->timeToLive;
 
       ++this->count;
     }
   else
-    PRINTF(4)("maximum count of particles reached not adding any more\n");
+    PRINTF(5)("maximum count of particles reached not adding any more\n");
 }
 
Index: orxonox/trunk/src/lib/graphics/particles/particle_system.h
===================================================================
--- orxonox/trunk/src/lib/graphics/particles/particle_system.h	(revision 4010)
+++ orxonox/trunk/src/lib/graphics/particles/particle_system.h	(revision 4017)
@@ -10,12 +10,14 @@
 #include "vector.h"
 
-#define PARTICLE_DOT_MASK           0x00001
-#define PARTICLE_SPRITE_MASK        0x00010
-#define PARTICLE_MODEL_MASK         0x00100
-#define PARTICLE_WORDL_ENTITY_MASK  0x01000
-#define PARTICLE_MULTI_MASK         0x10000
+#define PARTICLE_DOT_MASK           0x000001
+#define PARTICLE_SPARK_MASK         0x000010
+#define PARTICLE_SPRITE_MASK        0x000100
+#define PARTICLE_MODEL_MASK         0x001000
+#define PARTICLE_WORDL_ENTITY_MASK  0x010000
+#define PARTICLE_MULTI_MASK         0x100000
 
 //! An enumerator for the different types of particles.
 typedef enum PARTICLE_TYPE {PARTICLE_DOT = PARTICLE_DOT_MASK,
+			    PARTICLE_SPARK = PARTICLE_SPARK_MASK,
 			    PARTICLE_SPRITE = PARTICLE_SPRITE_MASK,
 			    PARTICLE_MULTI_SPRITE = PARTICLE_SPRITE_MASK | PARTICLE_MULTI_MASK,
@@ -41,4 +43,6 @@
   float radius;               //!< The current size of this particle.
   float radiusIt;             //!< The difference of the Size per second.
+
+  PARTICLE_TYPE type;
 
   Particle* next;             //!< pointer to the next particle in the List. (NULL if no preceding one)
