Synchronize DiveMelee checks

This commit is contained in:
Imbris
2023-04-07 01:48:57 -04:00
parent e20cf5f14f
commit 2cc2aa86f4

View File

@ -912,7 +912,11 @@ impl CharacterAbility {
..
} => {
// If either in the air or is on ground and able to be activated from
// ground
// ground.
//
// NOTE: there is a check in CharacterState::from below that must be kept in
// sync with the conditions here (it determines whether this starts in a
// movement or buildup stage).
(data.physics.on_ground.is_none() || buildup_duration.is_some())
&& update.energy.try_change_by(-*energy_cost).is_ok()
},
@ -2792,10 +2796,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
ability_info,
},
timer: Duration::default(),
// TODO: is this supposed to match the change in `requirements_paid` to just check
// `on_ground.is_non()` instead of checking vertical speed? Or is difference
// intended?
stage_section: if data.vel.0.z < -*vertical_speed || buildup_duration.is_none() {
stage_section: if data.physics.on_ground.is_none() || buildup_duration.is_none() {
StageSection::Movement
} else {
StageSection::Buildup