diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server.rs | 4 | ||||
-rw-r--r-- | src/shared/ability.rs | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/server.rs b/src/server.rs index aa3e3dc..1b31338 100644 --- a/src/server.rs +++ b/src/server.rs @@ -303,9 +303,7 @@ fn imperative_attack_attack( position.0, target_player, ))); - if ability_slot != AbilitySlot::A { - *imperative = Imperative::Idle; - } + *imperative = Imperative::AttackTarget(AbilitySlot::A, target_player); } } } 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); + } }, ) }); |