couldnt interact with self.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user