aboutsummaryrefslogtreecommitdiffstats
path: root/src/server.rs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-24 15:01:04 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-24 15:01:04 +0100
commit876fd9d60de9c09e8657a2cb70fd55fd041d1f97 (patch)
tree8d30385f6b795f706888b036e30506e51985f922 /src/server.rs
parentf7428e317d282856d05ffc37b6ba474c5e9973ce (diff)
feat: color projectiles
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/server.rs b/src/server.rs
index 4169178..84f9235 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -319,12 +319,12 @@ fn imperative_attack_attack(
entity_map: Res<EntityMap>,
mut commands: Commands,
mut cooldowns: Query<&mut Cooldown>,
- mut players: Query<(&PlayerId, &mut Imperative, &EffectiveStats)>,
+ mut players: Query<(&PlayerId, &mut Imperative, &EffectiveStats, &PlayerColor)>,
mut positions: Query<&mut PlayerPosition>,
shapes: Query<&Shape>,
champions: Query<&Champion>,
) {
- for (id, mut imperative, effective_stats) in players.iter_mut() {
+ for (id, mut imperative, effective_stats, player_color) in players.iter_mut() {
let Some(entity) = entity_map.0.get(&id.0) else {
*imperative = Imperative::Idle;
continue;
@@ -366,11 +366,10 @@ fn imperative_attack_attack(
} else {
base_cooldown.0[ability_slot]
};
- commands.spawn(ProjectileBundle::new(ability.to_projectile(
- *id,
- position.0,
- target_player,
- )));
+ commands.spawn(ProjectileBundle::new(
+ ability.to_projectile(*id, position.0, target_player),
+ ProjectileColor(player_color.0),
+ ));
*imperative = Imperative::AttackTarget(AbilitySlot::A, target_player);
}
}