aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Pouar <pouar@pouar.net>2020-07-23 09:34:39 -0500
committerGravatar Pouar <pouar@pouar.net>2020-07-23 09:34:39 -0500
commitfacc72d2d92c7c8cfdd53830d666a1d370c59ec3 (patch)
tree9fcb13c9eef12ba1702a463b63d470b277bf06f9
parentuse destructuring-bind (diff)
forgot this means something different when in that loop
-rw-r--r--core/classes.lisp15
1 files changed, 10 insertions, 5 deletions
diff --git a/core/classes.lisp b/core/classes.lisp
index 8b80329..771318d 100644
--- a/core/classes.lisp
+++ b/core/classes.lisp
@@ -555,11 +555,16 @@
initargs
(declare (ignore health energy)
(ignorable base-health base-attack base-defense base-speed))
- (cond (base-health-p (setf (getf (base-stats-of c) :health) base-health))
- (base-attack-p (setf (getf (base-stats-of c) :attack) base-attack))
- (base-defense-p (setf (getf (base-stats-of c) :defence) base-defense))
- (base-speed-p (setf (getf (base-stats-of c) :speed) base-speed))
- (base-energy-p (setf (getf (base-stats-of c) :energy) base-energy)))
+ (when base-health-p
+ (setf (getf (base-stats-of c) :health) base-health))
+ (when base-attack-p
+ (setf (getf (base-stats-of c) :attack) base-attack))
+ (when base-defense-p
+ (setf (getf (base-stats-of c) :defence) base-defense))
+ (when base-speed-p
+ (setf (getf (base-stats-of c) :speed) base-speed))
+ (when base-energy-p
+ (setf (getf (base-stats-of c) :energy) base-energy))
(unless healthp
(setf (health-of c) (calculate-stat c :health)))
(unless energyp