diff --git a/desktop/src-common/advent/actions.clj b/desktop/src-common/advent/actions.clj index cf98621e..8fce9e71 100644 --- a/desktop/src-common/advent/actions.clj +++ b/desktop/src-common/advent/actions.clj @@ -75,11 +75,14 @@ distance (dist from-x from-y target-x target-y) moved-x (* 1.5 (/ delta-x distance)) moved-y (* 1.5 (/ delta-y distance))] - (when (< distance 1) - (swap! targets-left rest)) - (update-in entities [target-id] - #(assoc (jump-to screen entities % [(+ moved-x from-x) (+ moved-y from-y)]) - :anim (if (< delta-x 0) left right)))))) + (if (< distance 1) + (do (swap! targets-left rest) + entities) + (update-in entities [target-id] + #(assoc (jump-to screen entities % [(+ moved-x from-x) (+ moved-y from-y)]) + :anim (cond (< delta-x 0) left + (> delta-x 0) right + :else (:anim %)))))))) (done? [this screen entities] (let [{from-x :x from-y :y :keys [left right anim] :as target-entity} (entities target-id)]