From: Alexander Monakov Date: Fri, 31 Dec 2010 00:41:20 +0000 (+0300) Subject: Simplify crouch animations X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=cc377fcd2e0bb5bc2ea9bda2dec2210bca474dbe;p=lugaru.git Simplify crouch animations --- 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();