Fix death detection durring getting attacked
authorLukas Jiriste <ljiriste@student.42prague.com>
Fri, 18 Oct 2024 07:59:52 +0000 (09:59 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Fri, 18 Oct 2024 07:59:52 +0000 (09:59 +0200)
ex00/ClapTrap.cpp

index b2695cebe09b4cad7e5af31f606a54954204990d..0acda6c4ccf3267e06c64c4208f7d3c27300f360 100644 (file)
@@ -50,7 +50,7 @@ void  ClapTrap::takeDamage(unsigned int amount)
 {
        if (m_hp == 0)
                std::cout << "ClapTrap " << m_name << " is alread dead.\n";
-       else if (amount > m_hp)
+       else if (amount >= m_hp)
        {
                std::cout << "ClapTrap " << m_name
                        << " takes " << amount << " damage and dies\n";