]> git.jsancho.org Git - lugaru.git/commitdiff
Fix a few GCC5 and GCC6 warnings
authorRémi Verschelde <rverschelde@gmail.com>
Sat, 28 Jan 2017 21:14:01 +0000 (22:14 +0100)
committerRémi Verschelde <rverschelde@gmail.com>
Sat, 28 Jan 2017 21:14:01 +0000 (22:14 +0100)
Source/Objects/Object.cpp
Source/Objects/Person.cpp

index 081f23de9686df7fea95b21a5c034f41948c0b2c..a2fcc9eb27f6a07a910e99e7d1424c3f6bbe583d 100644 (file)
@@ -556,7 +556,8 @@ void Object::LoadObjectsFromFile(FILE* tfile, bool skip)
     int numobjects;
     int type;
     XYZ position;
-    float yaw, pitch, scale, lastscale;
+    float yaw, pitch, scale;
+    float lastscale = 1.0f;
     funpackf(tfile, "Bi", &numobjects);
     if (!skip) {
         objects.clear();
index 1ac664c896b2dab753eab5890b0e4ce61d7e9715..891646ab830aef23d6852817c6e843ec3cb970ab 100644 (file)
@@ -2177,13 +2177,9 @@ void Person::DoAnimations()
         }
         if (animTarget == jumpupanim || animTarget == jumpdownanim || isFlip()) {
             float gLoc[3];
-            float vel[3];
             gLoc[0] = coords.x;
             gLoc[1] = coords.y;
             gLoc[2] = coords.z;
-            vel[0] = velocity.x;
-            vel[1] = velocity.y;
-            vel[2] = velocity.z;
 
             if (id == 0) {
                 OPENAL_3D_SetAttributes(channels[whooshsound], gLoc);
@@ -4800,13 +4796,9 @@ void Person::DoStuff()
 
         if (animTarget == jumpupanim || animTarget == jumpdownanim || isFlip()) {
             float gLoc[3];
-            float vel[3];
             gLoc[0] = coords.x;
             gLoc[1] = coords.y;
             gLoc[2] = coords.z;
-            vel[0] = velocity.x;
-            vel[1] = velocity.y;
-            vel[2] = velocity.z;
 
             if (id == 0) {
                 OPENAL_3D_SetAttributes(channels[whooshsound], gLoc);
@@ -7601,7 +7593,7 @@ void Person::doAI()
         if (aitype == pathfindtype) {
             if (finalpathfindpoint == -1) {
                 float closestdistance;
-                float tempdist;
+                float tempdist = 0.0f;
                 int closest;
                 XYZ colpoint;
                 closest = -1;
@@ -7631,7 +7623,7 @@ void Person::doAI()
             }
             if (targetpathfindpoint == -1) {
                 float closestdistance;
-                float tempdist;
+                float tempdist = 0.0f;
                 int closest;
                 XYZ colpoint;
                 closest = -1;