Minor bugfix

master
Mark 2024-02-16 18:26:55 -08:00
parent d3195983ec
commit de07e763c3
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
1 changed files with 9 additions and 4 deletions

View File

@ -113,10 +113,15 @@ fn event(state, event) {
}
fn step(state) {
radialbar::set_val("shield",
state.player_ship().current_shields()
/ state.player_ship().stat_shield_strength()
);
if state.player_ship().stat_shield_strength() == 0.0 {
radialbar::set_val("shield", 0.0);
} else {
radialbar::set_val("shield",
state.player_ship().current_shields()
/ state.player_ship().stat_shield_strength()
);
}
radialbar::set_val("hull",
state.player_ship().current_hull()
/ state.player_ship().total_hull()