]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Person.h
Simplify crouch animations
[lugaru.git] / Source / Person.h
index 27666e4bf904fe99cd04b1d1c0b1d3e50710a665..8f8006ad3a0e24df9924f1061a864451565d4c30 100644 (file)
@@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Sprite.h"
 #include <cmath>
 #include "Weapons.h"
+#include "Animation.h"
 
 #define passivetype 0
 #define guardtype 1
@@ -322,16 +323,34 @@ class Person
                void DoBloodBig(float howmuch, int which);
                bool DoBloodBigWhere(float howmuch, int which, XYZ where);
                
-               bool wasIdle();
-               bool isIdle();
+               bool wasIdle()
+               {
+                 return animation_bits[currentanimation] & ab_idle;
+               }
+               bool isIdle()
+               {
+                 return animation_bits[targetanimation] & ab_idle;
+               }
                int getIdle();
                
-               bool isSitting();
-               bool isSleeping();
-               
-               
-               bool wasCrouch();
-               bool isCrouch();
+               bool isSitting()
+               {
+                 return animation_bits[targetanimation] & ab_sit;
+               }
+
+               bool isSleeping()
+               {
+                 return animation_bits[targetanimation] & ab_sleep;
+               }
+
+               bool wasCrouch()
+               {
+                 return animation_bits[currentanimation] & ab_crouch;
+               }
+               bool isCrouch()
+               {
+                 return animation_bits[targetanimation] & ab_crouch;
+               }
                int getCrouch();
                
                bool wasStop();
@@ -373,4 +392,5 @@ class Person
                void RagDoll(bool checkcollision);
 };
 
+extern Person player[maxplayers];
 #endif