]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Person.cpp
Updating newdetail more often to avoid storing bad value, and added a newline at...
[lugaru.git] / Source / Person.cpp
index f0b00193a059cedf58339f9857d904e1745238c7..acd6647a81866e4d88a86b76f3c1102f15d4e6d3 100644 (file)
@@ -1839,7 +1839,7 @@ void Person::RagDoll(bool checkcollision)
 
 /* EFFECT
  */
-void Person::FootLand(bodyparts whichfoot, float opacity)
+void Person::FootLand(bodypart whichfoot, float opacity)
 {
     if ((whichfoot != leftfoot) && (whichfoot != rightfoot)) {
         cerr << "FootLand called on wrong bodypart" << endl;
@@ -4181,6 +4181,9 @@ void Person::DoAnimations()
                 oldrot = 0;
                 targetrot = 0;
             }
+            if (frameCurrent >= Animation::animations[animCurrent].frames.size()) {
+                frameCurrent = Animation::animations[animCurrent].frames.size() - 1;
+            }
             if (animCurrent != oldanimCurrent || animTarget != oldanimTarget || ((frameCurrent != oldframeCurrent || frameTarget != oldframeTarget) && !calcrot)) {
                 //Old rotates
                 for (int i = 0; i < skeleton.joints.size(); i++) {
@@ -4234,9 +4237,6 @@ void Person::DoAnimations()
                     }
                 }
             }
-            if (frameCurrent >= Animation::animations[animCurrent].frames.size()) {
-                frameCurrent = Animation::animations[animCurrent].frames.size() - 1;
-            }
 
             oldanimCurrent = animCurrent;
             oldanimTarget = animTarget;