Fix HealthComponent

This commit is contained in:
TrueBabyChaise
2021-05-20 16:50:00 +02:00
parent b318442dc8
commit a8cd709874
3 changed files with 4 additions and 52 deletions
+4 -3
View File
@@ -30,14 +30,15 @@ namespace BBM
void HealthComponent::takeDmg(unsigned int damage)
{
if (damage >= this->_healthPoint)
if (damage >= this->_healthPoint) {
this->_healthPoint = 0;
this->die();
else
} else
this->_healthPoint -= damage;
}
void HealthComponent::die(void)
{
this->setDisable(true);
this->_entity.setDisable(true)
}
}