From 5d12e35825a53c528e839a24140d02f861bde28f Mon Sep 17 00:00:00 2001 From: Adam JOLY Date: Wed, 27 Nov 2024 12:28:48 +0100 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=E2=9C=A8=E3=80=8D=20feat(Ex00):=20Fin?= =?UTF-8?q?ished=20ClapTrap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ex00/ClapTrap.cpp | 6 ++---- ex00/main.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ex00/ClapTrap.cpp b/ex00/ClapTrap.cpp index de16343..da41823 100644 --- a/ex00/ClapTrap.cpp +++ b/ex00/ClapTrap.cpp @@ -6,13 +6,11 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/11/20 14:29:16 by adjoly #+# #+# */ -/* Updated: 2024/11/27 11:55:35 by adjoly ### ########.fr */ +/* Updated: 2024/11/27 12:11:14 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ #include "ClapTrap.hpp" -#include -#include #include ClapTrap::ClapTrap(void) : @@ -60,7 +58,7 @@ void ClapTrap::attack(const std::string& target) { void ClapTrap::takeDamage(unsigned int amount) { log("🥊", _name, "take " + iToS(amount) + " damage"); - if (_health >= amount) { + if (_health <= amount) { log("💀", _name, "is dead HAHA"); _health = 0; } else { diff --git a/ex00/main.cpp b/ex00/main.cpp index 191775d..32007bf 100644 --- a/ex00/main.cpp +++ b/ex00/main.cpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/11/20 14:25:07 by adjoly #+# #+# */ -/* Updated: 2024/11/27 11:52:11 by adjoly ### ########.fr */ +/* Updated: 2024/11/27 12:28:17 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */