diff options
Diffstat (limited to 'src/shared/ability.rs')
-rw-r--r-- | src/shared/ability.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shared/ability.rs b/src/shared/ability.rs index f6a0ff4..9502151 100644 --- a/src/shared/ability.rs +++ b/src/shared/ability.rs @@ -220,6 +220,7 @@ fn dash_activation(dash: Dash) -> DirectionalAbilityActivation { commands.add(move |world: &mut World| { world.run_system_once( move |players: Query<(Entity, &PlayerId)>, + mut imperatives: Query<&mut Imperative>, mut set: ParamSet<( Query<&mut PlayerPosition>, Query<(&PlayerId, &PlayerPosition)>, @@ -288,6 +289,10 @@ fn dash_activation(dash: Dash) -> DirectionalAbilityActivation { source_player, damage: dash.damage, })); + if let Ok(mut imperative) = imperatives.get_mut(source_entity) { + *imperative = + Imperative::AttackTarget(AbilitySlot::A, collision_id); + } } }, ) @@ -364,6 +369,7 @@ fn pull_activation(pull: Pull) -> DirectionalAbilityActivation { commands.add(move |world: &mut World| { world.run_system_once( move |players: Query<(Entity, &PlayerId)>, + mut imperatives: Query<&mut Imperative>, mut set: ParamSet<( Query<&mut PlayerPosition>, Query<(&PlayerId, &PlayerPosition)>, @@ -438,6 +444,9 @@ fn pull_activation(pull: Pull) -> DirectionalAbilityActivation { source_player, damage: pull.damage, })); + if let Ok(mut imperative) = imperatives.get_mut(source_entity) { + *imperative = Imperative::AttackTarget(AbilitySlot::A, collision_id); + } }, ) }); |