Match CPlayerState::StartTransitionToVisor

This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-05 19:08:27 +03:00
parent 8dd881eab1
commit e20618ee83
No known key found for this signature in database
GPG Key ID: E224F951761145F8
1 changed files with 11 additions and 5 deletions

View File

@ -40,6 +40,8 @@ static const float kBaseHealthCapacity = 99.f;
static const float kDefaultKnockbackResistance = 50.f; static const float kDefaultKnockbackResistance = 50.f;
static const float kMaxVisorTransitionFactor = 0.2f; static const float kMaxVisorTransitionFactor = 0.2f;
static inline void do_nothing() {}
uint CPlayerState::GetBitCount(uint val) { uint CPlayerState::GetBitCount(uint val) {
int bits = 0; int bits = 0;
for (; val != 0; val >>= 1) { for (; val != 0; val >>= 1) {
@ -317,9 +319,13 @@ void CPlayerState::ResetVisor() {
} }
void CPlayerState::StartTransitionToVisor(CPlayerState::EPlayerVisor visor) { void CPlayerState::StartTransitionToVisor(CPlayerState::EPlayerVisor visor) {
if (x18_transitioningVisor == visor) if (visor == x18_transitioningVisor)
return; return;
x18_transitioningVisor = visor; x18_transitioningVisor = visor;
if (x18_transitioningVisor == x14_currentVisor)
return;
} }
void CPlayerState::UpdateVisorTransition(float dt) { void CPlayerState::UpdateVisorTransition(float dt) {