fix: removed negative life for mobs
This commit is contained in:
@@ -109,7 +109,7 @@ public:
|
||||
bool isAlive() const { return m_Health > 0; }
|
||||
const Tower* getLastDamageTower() { return m_LastDamage; }
|
||||
|
||||
void damage(float dmg, const Tower* damager) { m_Health -= dmg; m_LastDamage = damager; }
|
||||
void damage(float dmg, const Tower* damager) { m_Health = std::max(0.0f, m_Health - dmg); m_LastDamage = damager; }
|
||||
void heal(float heal) { m_Health = std::min((float)getStats()->getMaxLife(), m_Health + heal); }
|
||||
|
||||
float getX() const { return m_X; }
|
||||
|
||||
Reference in New Issue
Block a user