Match CPlayerState::StartTransitionToVisor

Former-commit-id: e20618ee83
This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-05 19:08:27 +03:00
parent 2638a5a81a
commit 7ba573dfda
1 changed files with 11 additions and 5 deletions

View File

@ -28,10 +28,10 @@ static const float kComboAmmoPeriods[] = {
};
static const char* kVisorNames[] = {
"CombatVisor",
"XRayVisor",
"ScanVisor",
"ThermalVisor",
"CombatVisor",
"XRayVisor",
"ScanVisor",
"ThermalVisor",
};
static const float kEnergyTankCapacity = 100.f;
@ -40,6 +40,8 @@ static const float kBaseHealthCapacity = 99.f;
static const float kDefaultKnockbackResistance = 50.f;
static const float kMaxVisorTransitionFactor = 0.2f;
static inline void do_nothing() {}
uint CPlayerState::GetBitCount(uint val) {
int bits = 0;
for (; val != 0; val >>= 1) {
@ -317,9 +319,13 @@ void CPlayerState::ResetVisor() {
}
void CPlayerState::StartTransitionToVisor(CPlayerState::EPlayerVisor visor) {
if (x18_transitioningVisor == visor)
if (visor == x18_transitioningVisor)
return;
x18_transitioningVisor = visor;
if (x18_transitioningVisor == x14_currentVisor)
return;
}
void CPlayerState::UpdateVisorTransition(float dt) {