Now it works

This commit is contained in:
Tleety
2016-03-13 22:13:37 +01:00
parent 83ae87594f
commit ce2fcd9109
+1 -1
View File
@@ -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;