From ce2fcd91098876e0996ef906dab12bb190ea31b5 Mon Sep 17 00:00:00 2001 From: Tleety Date: Sun, 13 Mar 2016 22:13:37 +0100 Subject: [PATCH] Now it works --- src/Game/Systems/HealthHUDSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Game/Systems/HealthHUDSystem.cpp b/src/Game/Systems/HealthHUDSystem.cpp index bfc63700..70ccf465 100644 --- a/src/Game/Systems/HealthHUDSystem.cpp +++ b/src/Game/Systems/HealthHUDSystem.cpp @@ -35,7 +35,7 @@ void HealthHUDSystem::Update(double dt) if(entity.HasComponent("Fill")) { double health = (const double&)entityIDParent["Health"]["Health"]; - double maxHealth = (const double&)entityIDParent["Health"]["Health"]; + double maxHealth = (const double&)entityIDParent["Health"]["MaxHealth"]; float healthPercentage = health/maxHealth; entity["Fill"]["Color"] = glm::vec4(1.0 - healthPercentage, 0.f, healthPercentage, glm::vec4(entity["Fill"]["Color"]).a); entity["Fill"]["Percentage"] = (double)healthPercentage;