fixed using inventory.

This commit is contained in:
2015-04-21 17:55:16 -07:00
parent ef46799b61
commit 7b6d0f7a88
2 changed files with 9 additions and 5 deletions

View File

@@ -75,10 +75,14 @@
(println "clicked " x y)
(let [interaction (first (filter #((:mouse-in? %) entities x y)
(get-in entities [:room :interactions])))
interacting-entity (first (sort-by (comp - :baseline) (filter #(and (:mouse-in? %)
(:get-script %)
((:mouse-in? %) entities x y))
(vals (dissoc (get-in entities [:room :entities]) :ego)))))
interactable-entities (if (= (doto (get-in entities [:cursor :current]) println) :main)
(vals (dissoc (get-in entities [:room :entities]) :ego))
(vals (get-in entities [:room :entities])))
interacting-entity (first (sort-by (comp - :baseline)
(filter #(and (:mouse-in? %)
(:get-script %)
((:mouse-in? %) entities x y))
interactable-entities)))
current-action (get-in entities [:actions :current])
;; TODO - hacky way of resetting queue