From cc377fcd2e0bb5bc2ea9bda2dec2210bca474dbe Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Fri, 31 Dec 2010 03:41:20 +0300 Subject: [PATCH] Simplify crouch animations --- Source/Person.cpp | 10 ---------- Source/Person.h | 12 +++++++++--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Source/Person.cpp b/Source/Person.cpp index 3f64360..1301b8f 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -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; diff --git a/Source/Person.h b/Source/Person.h index 1749a56..8f8006a 100644 --- a/Source/Person.h +++ b/Source/Person.h @@ -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(); -- 2.39.2