]> git.jsancho.org Git - lugaru.git/commitdiff
Fixed double set of velocity var
authorCôme Chilliet <come@chilliet.eu>
Thu, 22 Dec 2016 20:15:45 +0000 (21:15 +0100)
committerCôme Chilliet <come@chilliet.eu>
Thu, 22 Dec 2016 20:15:45 +0000 (21:15 +0100)
Source/Objects/Person.cpp

index a500e2a51ec82157174cf8b94fbb56b2405f71bf..af2f53bfc7b126164002b05c8e7bd0af334dbc62 100644 (file)
@@ -5915,8 +5915,9 @@ void Person::DoStuff()
             velocity.y = 0;
             if (velspeed < multiplier * 300 * scale) {
                 velocity = 0;
-            } else
+            } else {
                 velocity -= velocity / velspeed * multiplier * 300 * scale;
+            }
             if (velspeed > 5 && (isLanding() || isLandhard())) {
                 skiddingdelay += multiplier;
                 if (skiddelay <= 0) {
@@ -5924,17 +5925,13 @@ void Person::DoStuff()
                     FootLand(rightfoot, .5);
                     skiddelay = .02;
                 }
-            } else
+            } else {
                 skiddingdelay = 0;
+            }
         }
 
         if (isLandhard()) {
             velspeed = findLength(&velocity);
-            velocity.y = 0;
-            if (velspeed < multiplier * 600 * scale) {
-                velocity = 0;
-            } else
-                velocity -= velocity / velspeed * multiplier * 600 * scale;
             velocity = 0;
             if (velspeed > 5 && (isLanding() || isLandhard())) {
                 skiddingdelay += multiplier;
@@ -5943,8 +5940,9 @@ void Person::DoStuff()
                     FootLand(rightfoot, .5);
                     skiddelay = .02;
                 }
-            } else
+            } else {
                 skiddingdelay = 0;
+            }
         }
 
         if (skiddingdelay < 0)