hotfix: health bar showing incorrect value

This commit is contained in:
Muhammad Nauman Raza 2024-05-27 23:22:57 +01:00
parent 27b3d44fdb
commit 7feeafb769
No known key found for this signature in database
GPG key ID: B0EF3A98B29ADB1D

View file

@ -116,7 +116,7 @@ pub fn render_ui(
egui::Grid::new("Stats")
.spacing(egui::Vec2::new(20., 10.))
.show(ui, |ui| {
let health_bar = egui::widgets::ProgressBar::new(player.health)
let health_bar = egui::widgets::ProgressBar::new(player.health / player.health_max)
.desired_width(window_width / 10.);
let mut stamina_bar =
egui::widgets::ProgressBar::new(player.stamina / player.stamina_max)