feature: Implement FallSpeedBehavior (#1084)

* Hacky FallSpeedBehavior

* Fixup

* Make it more robust like speedboost
add check for default
Fix error in GetActiveSpeedboosts

* simplify and address feedback
This commit is contained in:
Aaron Kimbrell
2023-05-13 09:30:59 -05:00
committed by GitHub
parent 07803a7ca2
commit 739eae5244
6 changed files with 75 additions and 3 deletions

View File

@@ -320,7 +320,7 @@ void ControllablePhysicsComponent::RemoveSpeedboost(float value) {
// Recalculate speedboost since we removed one
m_SpeedBoost = 0.0f;
if (m_ActiveSpeedBoosts.size() == 0) { // no active speed boosts left, so return to base speed
if (m_ActiveSpeedBoosts.empty()) { // no active speed boosts left, so return to base speed
auto* levelProgressionComponent = m_Parent->GetComponent<LevelProgressionComponent>();
if (levelProgressionComponent) m_SpeedBoost = levelProgressionComponent->GetSpeedBase();
} else { // Used the last applied speedboost

View File

@@ -276,7 +276,7 @@ public:
* The speed boosts of this component.
* @return All active Speed boosts for this component.
*/
std::vector<float> GetActiveSpeedboosts() { return m_ActivePickupRadiusScales; };
std::vector<float> GetActiveSpeedboosts() { return m_ActiveSpeedBoosts; };
/**
* Activates the Bubble Buff