summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--the-price-of-a-cup-of-coffee.lisp6
1 files changed, 2 insertions, 4 deletions
diff --git a/the-price-of-a-cup-of-coffee.lisp b/the-price-of-a-cup-of-coffee.lisp
index f13e060..f79320c 100644
--- a/the-price-of-a-cup-of-coffee.lisp
+++ b/the-price-of-a-cup-of-coffee.lisp
@@ -136,9 +136,6 @@
(frame 0)
(next-frame-at 0))
-(defmethod (setf face) :after (new-val (human human))
- (setf (frame human) 0))
-
(defun x-pos (person)
(sdl2:rect-x (pos person)))
@@ -159,7 +156,8 @@
(defun get-frame-rect (human)
(with-slots (faces face frame) human
- (aref (funcall face faces) frame)))
+ (let ((seq (funcall face faces)))
+ (aref seq (min (1- (length seq)) frame)))))
(defmethod initialize-instance :after ((human human) &key)
(setf (walk-speed human) 6)