From 1a427824a97ec5fcbd3945cacb584a6fe0f248d8 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 9 Mar 2017 18:31:17 +0100 Subject: [PATCH] Upgrade hbarmor mod to version 0.3.0 --- mods/HUD/hbarmor/README.md | 2 +- mods/HUD/hbarmor/init.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/HUD/hbarmor/README.md b/mods/HUD/hbarmor/README.md index 680f9c443..2b87b975f 100644 --- a/mods/HUD/hbarmor/README.md +++ b/mods/HUD/hbarmor/README.md @@ -1,6 +1,6 @@ # HUD bar for `3d_armor` [`hbarmor`] -* Version: 0.2.0 +* Version: 0.3.0 ## Description This mod adds a simple HUD bar which displays the current damage diff --git a/mods/HUD/hbarmor/init.lua b/mods/HUD/hbarmor/init.lua index fb697e729..1e444e41d 100644 --- a/mods/HUD/hbarmor/init.lua +++ b/mods/HUD/hbarmor/init.lua @@ -93,7 +93,7 @@ function hbarmor.set_armor(player_name, ges_state, items) lvl = 0 end - hbarmor.armor[player_name] = math.min(lvl* (items * (100 / max_items)), 100) + hbarmor.armor[player_name] = math.max(0, math.min(lvl* (items * (100 / max_items)), 100)) end -- update hud elemtens if value has changed