This commit is contained in:
Camille Chauvet
2023-08-29 15:15:12 +02:00
parent 6669f8b137
commit 91c1a2d3e2
7 changed files with 14 additions and 11 deletions

View File

@ -43,7 +43,7 @@ ClapTrap& ClapTrap::operator=(const ClapTrap& src)
void ClapTrap::beRepaired(unsigned int amount)
{
if (this->_life == 0 || this->_energy == 0)
if (this->_life <= 0 || this->_energy == 0)
{
std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return;
@ -55,7 +55,7 @@ void ClapTrap::beRepaired(unsigned int amount)
void ClapTrap::takeDamage(unsigned int amount)
{
if (this->_life == 0 || this->_energy == 0)
if (this->_life <= 0)
{
std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return;
@ -66,7 +66,7 @@ void ClapTrap::takeDamage(unsigned int amount)
void ClapTrap::attack(const std::string &target)
{
if (this->_life == 0 || this->_energy == 0)
if (this->_life <= 0 || this->_energy == 0)
{
std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return;

View File

@ -50,7 +50,7 @@ void ScavTrap::guardGate()
void ScavTrap::attack(const std::string& target)
{
if (this->_life == 0 || this->_energy == 0)
if (this->_life <= 0 || this->_energy == 0)
{
std::cerr << "error: ScavTrap " << this->_name << " dead" << std::endl;
return;