mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 02:27:42 +00:00
CKnockBackController: Make CalculateExtraHurlVelocity() a const member function
This doesn't modify internal member state, so it can be marked const While we're at it we can also invert the conditional to unindent the main calculation.
This commit is contained in:
@@ -473,10 +473,12 @@ void CKnockBackController::ValidateState(const CPatterned& parent) {
|
||||
}
|
||||
}
|
||||
|
||||
float CKnockBackController::CalculateExtraHurlVelocity(CStateManager& mgr, float magnitude, float kbResistance) {
|
||||
if (magnitude > kbResistance)
|
||||
return (1.1f - 0.2f * mgr.GetActiveRandom()->Float()) * 2.f * (magnitude - kbResistance);
|
||||
return 0.f;
|
||||
float CKnockBackController::CalculateExtraHurlVelocity(CStateManager& mgr, float magnitude, float kbResistance) const {
|
||||
if (magnitude <= kbResistance) {
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
return (1.1f - 0.2f * mgr.GetActiveRandom()->Float()) * 2.f * (magnitude - kbResistance);
|
||||
}
|
||||
|
||||
void CKnockBackController::DoKnockBackAnimation(const zeus::CVector3f& backVec, CStateManager& mgr, CPatterned& parent,
|
||||
|
||||
Reference in New Issue
Block a user