From 5982d9e2fe932c31ab92e7edd918dbf6b46647f2 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 15 Sep 2014 16:54:18 -0700 Subject: [PATCH] accidentally disabled collision detection. --- desktop/src-common/advent/actions.clj | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/desktop/src-common/advent/actions.clj b/desktop/src-common/advent/actions.clj index 07bd9ab2..782bb483 100644 --- a/desktop/src-common/advent/actions.clj +++ b/desktop/src-common/advent/actions.clj @@ -46,11 +46,13 @@ (defn walk-to [entities target-id [final-x final-y]] (let [c (chan) entity (entities target-id) - path (conj (vec (take-nth 5 (advent.pathfind/visit-all - (:collision (:background entities)) - [(int (:x entity)) (int (:y entity))] - [(int final-x) (int final-y)]))) - [(int final-x) (int final-y)])] + path (vec (take-nth 5 (advent.pathfind/visit-all + (:collision (:background entities)) + [(int (:x entity)) (int (:y entity))] + [(int final-x) (int final-y)]))) + path (if (seq path) + (conj path [(int final-x) (int final-y)]) + [])] (doseq [[target-x target-y] path] (put! (get-in entities [:actions :channel]) (reify