CKnockBackController: Make GetKnockBackCharacterState() a const member function

This doesn't modify internal instance state, so this can be made const.
This commit is contained in:
Lioncash 2020-04-17 00:58:27 -04:00
parent 529d7e58bd
commit 49cc019699
2 changed files with 4 additions and 3 deletions

View File

@ -400,9 +400,10 @@ bool CKnockBackController::TickDeferredTimer(float dt) {
return false;
}
EKnockBackCharacterState CKnockBackController::GetKnockBackCharacterState(CPatterned& parent) {
if (parent.GetBodyController()->IsFrozen())
EKnockBackCharacterState CKnockBackController::GetKnockBackCharacterState(const CPatterned& parent) const {
if (parent.GetBodyController()->IsFrozen()) {
return parent.IsAlive() ? EKnockBackCharacterState::FrozenAlive : EKnockBackCharacterState::FrozenDead;
}
return parent.IsAlive() ? EKnockBackCharacterState::Alive : EKnockBackCharacterState::Dead;
}

View File

@ -99,7 +99,7 @@ private:
bool x82_26_locomotionDuringElectrocution : 1;
void ApplyImpulse(float dt, CPatterned& parent);
bool TickDeferredTimer(float dt);
EKnockBackCharacterState GetKnockBackCharacterState(CPatterned& parent);
EKnockBackCharacterState GetKnockBackCharacterState(const CPatterned& parent) const;
void ValidateState(CPatterned& parent);
float CalculateExtraHurlVelocity(CStateManager& mgr, float magnitude, float kbResistance);
void DoKnockBackAnimation(const zeus::CVector3f& backVec, CStateManager& mgr, CPatterned& parent, float magnitude);