From de07e763c31e8d7a67a1d7ccc91d6aa244cb024d Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 16 Feb 2024 18:26:55 -0800 Subject: [PATCH] Minor bugfix --- content/ui/flying.rhai | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/content/ui/flying.rhai b/content/ui/flying.rhai index 2922ad6..d889c1d 100644 --- a/content/ui/flying.rhai +++ b/content/ui/flying.rhai @@ -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()