]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Person.cpp
Stopped using Account pointers, and removed general difficulty setting (difficulty...
[lugaru.git] / Source / Person.cpp
index a9b5983919f8b45507ce5e1f364d73b23f1b5322..fb3c4450112b84200270596827ad267ca97d4df8 100644 (file)
@@ -523,7 +523,7 @@ void Person::CheckKick()
  *
  * USES:
  * GameTick/doPlayerCollisions - spread fire between players
- * GameTick/doDebugKeys - press f to ignite
+ * GameTick/doDevKeys - press f to ignite
  * Person::DoStuff - spread fire from lit campfires and bushes
  */
 void Person::CatchFire()
@@ -1468,14 +1468,15 @@ void Person::Reverse()
     velocity = 0;
     victim->velocity = 0;
 
-    if (aitype != playercontrolled)
+    if (aitype != playercontrolled) {
         feint = 0;
-    if (aitype != playercontrolled && Random() % 3 == 0 && escapednum < 2 && difficulty == 2)
-        feint = 1;
-    if (aitype != playercontrolled && Random() % 5 == 0 && escapednum < 2 && difficulty == 1)
-        feint = 1;
-    if (aitype != playercontrolled && Random() % 10 == 0 && escapednum < 2 && difficulty == 0)
-        feint = 1;
+        if (escapednum < 2) {
+            int chances = ((difficulty == 2) ? 3 : ((difficulty == 1) ? 5 : 10));
+            if ((Random() % chances) == 0) {
+                feint = 1;
+            }
+        }
+    }
 
     if (victim->id == 0 && Animation::animations[victim->animTarget].attack == reversal)
         numreversals++;
@@ -4181,6 +4182,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 +4238,6 @@ void Person::DoAnimations()
                     }
                 }
             }
-            if (frameCurrent >= Animation::animations[animCurrent].frames.size()) {
-                frameCurrent = Animation::animations[animCurrent].frames.size() - 1;
-            }
 
             oldanimCurrent = animCurrent;
             oldanimTarget = animTarget;