]> git.jsancho.org Git - lugaru.git/commitdiff
Simplify crouch animations
authorAlexander Monakov <amonakov@gmail.com>
Fri, 31 Dec 2010 00:41:20 +0000 (03:41 +0300)
committerAlexander Monakov <amonakov@gmail.com>
Fri, 31 Dec 2010 00:41:20 +0000 (03:41 +0300)
Source/Person.cpp
Source/Person.h

index 3f643607323b49c4f8a419b3bf85d678d384b04e..1301b8f71ab3ad51c59b1c2e981fdb702775cd26 100644 (file)
@@ -202,16 +202,6 @@ int Person::getIdle(){
        return 0;
 }
 
-bool Person::isCrouch(){
-       if(targetanimation==crouchanim||targetanimation==wolfcrouchanim)return 1;
-       else return 0;
-}
-
-
-bool Person::wasCrouch(){
-       if(currentanimation==crouchanim||currentanimation==wolfcrouchanim)return 1;
-       else return 0;
-}
 int Person::getCrouch(){
        if(creature==rabbittype)return crouchanim;
        if(creature==wolftype)return wolfcrouchanim;
index 1749a565791c561d4936c3940edb3d178feb62d8..8f8006ad3a0e24df9924f1061a864451565d4c30 100644 (file)
@@ -342,9 +342,15 @@ class Person
                {
                  return animation_bits[targetanimation] & ab_sleep;
                }
-               
-               bool wasCrouch();
-               bool isCrouch();
+
+               bool wasCrouch()
+               {
+                 return animation_bits[currentanimation] & ab_crouch;
+               }
+               bool isCrouch()
+               {
+                 return animation_bits[targetanimation] & ab_crouch;
+               }
                int getCrouch();
                
                bool wasStop();