From 93a3a824cffe040cedefb2432c76a58a71d3d496 Mon Sep 17 00:00:00 2001 From: Boutade Date: Sat, 19 Oct 2019 10:06:39 -0500 Subject: bug --- the-price-of-a-cup-of-coffee.lisp | 6 ++---- 1 file 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) -- cgit v1.2.3