]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Objects/Weapons.cpp
Fixing some warnings of cppcheck
[lugaru.git] / Source / Objects / Weapons.cpp
index 127c014cb41702bd2c10df4790514184369711e9..38ee55be357d52d38babdc9b223992e581f3e0a9 100644 (file)
@@ -27,6 +27,7 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include "Audio/Sounds.hpp"
 #include "Game.hpp"
 #include "Level/Awards.hpp"
+#include "Tutorial.hpp"
 
 extern float multiplier;
 extern Terrain terrain;
@@ -48,7 +49,6 @@ extern float woozy;
 extern float viewdistance;
 extern float blackout;
 extern bool freeze;
-extern int tutoriallevel;
 extern int numthrowkill;
 
 Model Weapon::throwingknifemodel;
@@ -248,16 +248,16 @@ void Weapon::DoStuff(int i)
                             Person::players[j]->jointVel(neck) += velocity * 2;
                             Person::players[j]->jointVel(rightshoulder) += velocity * 2;
                             Person::players[j]->jointVel(leftshoulder) += velocity * 2;
-                            if (bloodtoggle && tutoriallevel != 1)
+                            if (bloodtoggle && !Tutorial::active)
                                 Sprite::MakeSprite(cloudimpactsprite, footpoint, footvel, 1, 0, 0, .8, .3);
-                            if (tutoriallevel == 1)
+                            if (Tutorial::active)
                                 Sprite::MakeSprite(cloudimpactsprite, footpoint, footvel, 1, 1, 1, .8, .3);
                             footvel = tippoint - position;
                             Normalise(&footvel);
-                            if (bloodtoggle && tutoriallevel != 1)
+                            if (bloodtoggle && !Tutorial::active)
                                 Sprite::MakeSprite(bloodflamesprite, footpoint, footvel * -1, 1, 0, 0, .6, 1);
 
-                            if (tutoriallevel != 1) {
+                            if (!Tutorial::active) {
                                 if (Person::players[j]->weaponstuckwhere == 0)
                                     Person::players[j]->DoBloodBig(2, 205);
                                 if (Person::players[j]->weaponstuckwhere == 1)
@@ -1111,15 +1111,3 @@ int Weapons::Draw()
 Weapons::Weapons()
 {
 }
-
-Weapons::~Weapons()
-{
-    Weapon::stafftextureptr.destroy();
-    Weapon::knifetextureptr.destroy();
-    Weapon::lightbloodknifetextureptr.destroy();
-    Weapon::bloodknifetextureptr.destroy();
-    Weapon::swordtextureptr.destroy();
-    Weapon::lightbloodswordtextureptr.destroy();
-    Weapon::bloodswordtextureptr.destroy();
-}
-