]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/bosses.cpp
Get rid of false positive warnings from cppcheck.
[quix0rs-blobwars.git] / src / bosses.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 609b23f..385da51
@@ -1,5 +1,6 @@
 /*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -20,6 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "bosses.h"
 
+// this is used exclusively by the bosses
+Boss *self;
+
 void tankBossLevel()
 {
        if (player.health < 1)
@@ -398,11 +402,12 @@ void doBosses()
                                {
                                        debug(("Deleting unreferenced Boss...\n"));
                                        
+                                       if(map.mainBossPart == map.boss[i])
+                                               map.mainBossPart = NULL;
                                        delete map.boss[i];
                                        map.boss[i] = NULL;
-                               }
-                               
-                               self->referenced = false;
+                               } else
+                                       self->referenced = false;
                        }
                }
                else if (self->actionFinished())
@@ -436,7 +441,7 @@ bool isCorrectShieldFrequency(Entity *bullet)
                Math::removeBit(&bullet->flags, ENT_WEIGHTLESS);
                Math::removeBit(&bullet->flags, ENT_BOUNCES);
                
-               audio.playSound(SND_RICO1, CH_ANY);
+               audio.playSound(SND_RICO1, CH_ANY, bullet->x);
                
                return false;
        }
@@ -483,7 +488,7 @@ void checkBossBulletCollisions(Entity *bullet)
                                if (!(self->flags & ENT_IMMUNE))
                                {
                                        self->health -= bullet->damage;
-                                       audio.playSound(SND_CLANG, CH_ANY);
+                                       audio.playSound(SND_CLANG, CH_ANY, bullet->x);
                                        addColorParticles(bullet->x, bullet->y, Math::rrand(25, 75), -1);
                                        Math::removeBit(&bullet->flags, ENT_SPARKS);
                                        Math::removeBit(&bullet->flags, ENT_PUFFS);