From: Lukas Jiriste Date: Fri, 18 Oct 2024 07:59:52 +0000 (+0200) Subject: Fix death detection durring getting attacked X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=755ea05cadb6fc6eebbb51337f96def71d49d7b6;p=42%2FCPP_Module_03 Fix death detection durring getting attacked --- diff --git a/ex00/ClapTrap.cpp b/ex00/ClapTrap.cpp index b2695ce..0acda6c 100644 --- a/ex00/ClapTrap.cpp +++ b/ex00/ClapTrap.cpp @@ -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";