mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-29 17:02:11 +00:00
Fix HealthComponent
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user