Skip to content
Permalink
Browse files

Signal error on unfound animation to avoid infinite recursion.

  • Loading branch information...
Shinmera committed Jul 18, 2019
1 parent 64d252a commit 408cafc524ea620db6b6ba516bce3a25e8931981
Showing with 2 additions and 1 deletion.
  1. +2 −1 sprite.lisp
@@ -90,7 +90,8 @@ void main(){
(setf (animation subject) (aref (animations subject) index)))

(defmethod (setf animation) ((name symbol) (subject animated-sprite-subject))
(setf (animation subject) (find name (animations subject) :key #'sprite-animation-name)))
(setf (animation subject) (or (find name (animations subject) :key #'sprite-animation-name)
(error "No animation named ~s found." name))))

(defmethod (setf animation) ((animation sprite-animation) (subject animated-sprite-subject))
(unless (eql animation (animation subject))

0 comments on commit 408cafc

Please sign in to comment.
You can’t perform that action at this time.