aboutsummaryrefslogtreecommitdiffstats
path: root/src/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client.rs b/src/client.rs
index 277fc2c..bd2c448 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -482,11 +482,15 @@ fn player_champion(
const HEALTH_OFFSET: f32 = 4.;
-fn render_health(players: Query<(&Health, &PlayerPosition)>, mut gizmos: Gizmos) {
- for (health, position) in players.iter() {
+fn render_health(players: Query<(&Health, &PlayerPosition, &EffectiveStats)>, mut gizmos: Gizmos) {
+ for (health, position, effective_stats) in players.iter() {
let start = position.0 + Vec2::new(-PLAYER_RADIUS, PLAYER_RADIUS + HEALTH_OFFSET);
let end = position.0 + Vec2::new(PLAYER_RADIUS, PLAYER_RADIUS + HEALTH_OFFSET);
- gizmos.line_2d(start, start.lerp(end, health.0 / MAX_HEALTH), Color::RED);
+ gizmos.line_2d(
+ start,
+ start.lerp(end, health.0 / effective_stats.0.max_health),
+ Color::RED,
+ );
}
}