couldnt interact with self.

This commit is contained in:
Bryce Covert
2016-08-03 17:24:21 -07:00
parent c83d5a8e73
commit 62c9ceb5f9

View File

@@ -222,7 +222,7 @@ void main ()
(get-in entities [:room :interactions]))) )
(defn get-interacting-entity [entities x y]
(let [interactable-entities (if (= (doto (get-in entities [:cursor :current]) (#(log/info "clicked with " %)) ) :main)
(let [interactable-entities (if (= (doto (get-selected-inventory-item) (#(log/info "clicked with " %)) ) :main)
(vals (dissoc (get-in entities [:room :entities]) :ego))
(vals (get-in entities [:room :entities])))
interacting-entity (first (sort-by (comp - :baseline)
@@ -238,7 +238,6 @@ void main ()
interaction (get-interaction entities x y)
interacting-entity (get-interacting-entity entities x y)
current-action (get-in entities [:fg-actions :current])
;; TODO - hacky way of resetting queue
entities (if (and current-action
@@ -254,7 +253,7 @@ void main ()
(get-in entities [:cursor :came-from-inventory?])))
((or (when (and interacting-entity (not (:cursor interaction)))
(do (screen! hud :on-start-script)
((:get-script interacting-entity) (or (get-selected-inventory-item) (get-in entities [:cursor :current])) [x y])))
((:get-script interacting-entity) (doto (or (get-selected-inventory-item) (get-in entities [:cursor :current])) println) [x y])))
(when interaction
(do (screen! hud :on-start-script)
((:get-script interaction) (or (when (:cursor interaction) :main)