From 1b5c3883a441800e53986916ac066183578e5cfb Mon Sep 17 00:00:00 2001 From: Ygor Souza Date: Tue, 3 Aug 2021 06:34:36 +0200 Subject: [PATCH] Allow axe combo to reward energy without skillpoint When the character does not have the Double Strike Combo skill, the ability's stage_data only contains one element, and thus the stage_data.len() - 1 expression would set the max_energy_regen to 0. This change forces the multiplier to 1 in this specific case, so the axe can still reward energy without the combo skill point, to match the other weapons. --- CHANGELOG.md | 1 + common/src/comp/ability.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 339da87968..911adff707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Players no longer spawn underground if their waypoint is underground - Map will now zoom around the cursor's position and drag correctly - No more jittering while running down slopes with the glider out +- Axe normal attack rewards energy without skill points ## [0.10.0] - 2021-06-12 diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 98f5935bc7..44241a7607 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -1021,9 +1021,9 @@ impl CharacterAbility { 0 }; *max_energy_gain = *max_energy_gain - * ((energy_level + 1) * stage_data.len() as u16 - 1) as f32 + * ((energy_level + 1) * stage_data.len() as u16 - 1).max(1) as f32 / (Axe(DsRegen).max_level().unwrap() + 1) as f32 - * (stage_data.len() - 1) as f32; + * (stage_data.len() - 1).max(1) as f32; *scales_from_combo = skillset .skill_level(Axe(DsDamage)) .unwrap_or(None)