aboutsummaryrefslogtreecommitdiff
path: root/cpp03/ex04
diff options
context:
space:
mode:
Diffstat (limited to 'cpp03/ex04')
-rw-r--r--cpp03/ex04/ClapTrap.cpp4
-rw-r--r--cpp03/ex04/main.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/cpp03/ex04/ClapTrap.cpp b/cpp03/ex04/ClapTrap.cpp
index 550cef4..1dceb70 100644
--- a/cpp03/ex04/ClapTrap.cpp
+++ b/cpp03/ex04/ClapTrap.cpp
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/13 15:28:43 by charles #+# #+# */
-/* Updated: 2020/11/12 10:08:15 by cacharle ### ########.fr */
+/* Updated: 2020/11/17 16:49:36 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -71,7 +71,9 @@ void ClapTrap::takeDamage(unsigned int amount)
if (amount < m_armorDamageReduction)
amount = 0;
else
+ {
amount -= m_armorDamageReduction;
+ }
if (amount > m_hitPoints)
amount = m_hitPoints;
m_hitPoints -= amount;
diff --git a/cpp03/ex04/main.cpp b/cpp03/ex04/main.cpp
index 0358760..c080dc2 100644
--- a/cpp03/ex04/main.cpp
+++ b/cpp03/ex04/main.cpp
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/22 05:41:27 by cacharle #+# #+# */
-/* Updated: 2020/11/12 10:13:44 by cacharle ### ########.fr */
+/* Updated: 2020/11/17 16:49:46 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -28,7 +28,9 @@ int main(void)
devRandom.close();
}
else
+ {
seed = time(NULL);
+ }
srand(seed);
{