]> git.mxchange.org Git - quix0rs-blobwars.git/commitdiff
Fix addColorParticles() when color is not -1.
authorGuus Sliepen <guus@debian.org>
Sun, 9 Aug 2015 14:41:00 +0000 (16:41 +0200)
committerGuus Sliepen <guus@debian.org>
Sun, 9 Aug 2015 14:41:20 +0000 (16:41 +0200)
This only is used when ENT_PARTICLETRAIL is set, which might actually
not be used anywhere.

src/particles.cpp

index 942a79ddbad0243a4468f093da8e8230244a6ee2..66595ab597eb2a3c678c576526930aeb0093a227 100644 (file)
@@ -63,16 +63,15 @@ void addColorParticles(float x, float y, int amount, int color)
        for (int i = 0 ; i < amount ; i++)
        {
                if (color == -1)
-               {
                        c = Math::prand() % 5;
-                       switch (c)
-                       {
-                               case 0: c = graphics.white; break;
-                               case 1: c = graphics.grey; break;
-                               case 2: c = graphics.blue; break;
-                               case 3: c = graphics.cyan; break;
-                               case 4: c = graphics.red; break;
-                       }
+
+               switch (c)
+               {
+                       case 0: c = graphics.white; break;
+                       case 1: c = graphics.grey; break;
+                       case 2: c = graphics.blue; break;
+                       case 3: c = graphics.cyan; break;
+                       case 4: c = graphics.red; break;
                }
 
                dx = Math::rrand(-30, 30); dx /= 30;