fixing bugs.

This commit is contained in:
Bryce Covert
2017-04-11 06:23:26 -07:00
parent e208b96335
commit 2837f9ed4b
3 changed files with 29 additions and 16 deletions

View File

@@ -187,14 +187,15 @@
(defn start-animation
([entity anim]
(start-animation {:total-time 0} entity anim))
(start-animation {:total-time 0} entity anim))
([screen entity anim]
(let [new-anim (find-animation entity anim)]
(if (and anim (not= new-anim (:anim entity)))
(assoc entity
:anim new-anim
:anim-start (:total-time screen))
entity))))
(let [new-anim (find-animation entity anim)]
(if (and anim (not= new-anim (:anim entity)))
(assoc entity
:force-rerender true
:anim new-anim
:anim-start (:total-time screen))
entity))))
(defn stop [screen entities target-id & {:keys [face]}]
(update-in entities [:room :entities target-id] (comp #(start-animation screen % (or (:stand-override %) :stand) ) (if face #(assoc % :facing face) identity))))