diff --git a/rust/src/player/remote_player.rs b/rust/src/player/remote_player.rs index 9423da0..da5375e 100644 --- a/rust/src/player/remote_player.rs +++ b/rust/src/player/remote_player.rs @@ -326,6 +326,11 @@ impl RemotePlayer { double_health_bar.set_value(double_value); } } + + pub fn set_hp(&mut self, health: i32) { + self.health = health; + self.update_health_bar(); + } } #[godot_dyn] diff --git a/rust/src/replay.rs b/rust/src/replay.rs index a77119a..ca14ea5 100644 --- a/rust/src/replay.rs +++ b/rust/src/replay.rs @@ -308,6 +308,7 @@ impl INode for ReplayPlayback { character .bind_mut() .set_movement_dir(state.movement_dir.into()); + character.bind_mut().set_hp(state.health); let weapon = character.bind().get_weapon().clone(); if let Some(weapon) = weapon && weapon.dyn_bind().get_type() != state.current_weapon @@ -593,6 +594,7 @@ pub struct ReplayPlayerState { pub is_dead: bool, pub kills: u16, pub deaths: u16, + pub health: i32, } impl Player { @@ -610,6 +612,7 @@ impl Player { is_dead: character.dyn_bind().is_dead(), kills: player.data.kills, deaths: player.data.deaths, + health: character.dyn_bind().get_health(), }) } else { None