]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameTick.cpp
Fixed lots of errors spotted by cppcheck
[lugaru.git] / Source / GameTick.cpp
index c5f953f502b44c2b7b3e87ad0a18928201e500e0..8a7a54eae021af5b1f6d4a7191fe6fa6bc9f0c30 100644 (file)
@@ -3,20 +3,18 @@ Copyright (C) 2003, 2010 - Wolfire Games
 
 This file is part of Lugaru.
 
-Lugaru is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
+Lugaru is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
+Lugaru is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-See the GNU General Public License for more details.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 // Enable full math definitions
@@ -3890,7 +3888,7 @@ void doAerialAcrobatics()
                 }
             }
 
-            if (tempcollide && (/*Person::players[k]->jumptogglekeydown*/1 == 1 || Person::players[k]->aitype != playercontrolled))
+            if (tempcollide)
                 for (int l = 0; l < terrain.patchobjectnum[Person::players[k]->whichpatchx][Person::players[k]->whichpatchz]; l++) {
                     int i = terrain.patchobjects[Person::players[k]->whichpatchx][Person::players[k]->whichpatchz][l];
                     lowpoint = Person::players[k]->coords;
@@ -3972,7 +3970,6 @@ void doAerialAcrobatics()
                                                                 if (j <= 6 || j <= 25 && Person::players[k]->animTarget == jumpdownanim)
                                                                     break;
                                                                 if (Person::players[k]->animTarget == jumpupanim || Person::players[k]->animTarget == jumpdownanim) {
-                                                                    lowpoint = DoRotation(objects.model[i].facenormals[whichhit], 0, objects.yaw[k], 0);
                                                                     lowpoint = Person::players[k]->coords;
                                                                     lowpoint.y += (float)j / 13;
                                                                     lowpointtarget = lowpoint + facing * 1.3;
@@ -5489,7 +5486,7 @@ void doAI(unsigned i)
                     if (Person::players[0]->animTarget != rabbitkickanim && Person::players[0]->weaponactive != -1) {
                         if (weapons[Person::players[0]->weaponids[0]].getType() == knife) {
                             if (Person::players[i]->isIdle() || Person::players[i]->isCrouch() || Person::players[i]->isRun() || Person::players[i]->isFlip()) {
-                                if (abs(Random() % 2 == 0))
+                                if (abs(Random() % 2) == 0)
                                     Person::players[i]->setAnimation(backhandspringanim);
                                 else
                                     Person::players[i]->setAnimation(rollanim);
@@ -7198,7 +7195,6 @@ void Game::Tick()
                                  Person::players[i]->animTarget == rollanim ||
                                  Person::players[i]->animTarget == backhandspringanim ||
                                  Person::players[i]->isFlip() ||
-                                 Person::players[i]->isFlip() ||
                                  Person::players[i]->aitype != playercontrolled)) {
                             for (unsigned j = 0; j < weapons.size(); j++) {
                                 if ((weapons[j].velocity.x == 0 && weapons[j].velocity.y == 0 && weapons[j].velocity.z == 0 ||