couldnt interact with self.
This commit is contained in:
@@ -222,7 +222,7 @@ void main ()
|
|||||||
(get-in entities [:room :interactions]))) )
|
(get-in entities [:room :interactions]))) )
|
||||||
|
|
||||||
(defn get-interacting-entity [entities x y]
|
(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 (dissoc (get-in entities [:room :entities]) :ego))
|
||||||
(vals (get-in entities [:room :entities])))
|
(vals (get-in entities [:room :entities])))
|
||||||
interacting-entity (first (sort-by (comp - :baseline)
|
interacting-entity (first (sort-by (comp - :baseline)
|
||||||
@@ -238,7 +238,6 @@ void main ()
|
|||||||
interaction (get-interaction entities x y)
|
interaction (get-interaction entities x y)
|
||||||
interacting-entity (get-interacting-entity entities x y)
|
interacting-entity (get-interacting-entity entities x y)
|
||||||
current-action (get-in entities [:fg-actions :current])
|
current-action (get-in entities [:fg-actions :current])
|
||||||
|
|
||||||
;; TODO - hacky way of resetting queue
|
;; TODO - hacky way of resetting queue
|
||||||
|
|
||||||
entities (if (and current-action
|
entities (if (and current-action
|
||||||
@@ -254,7 +253,7 @@ void main ()
|
|||||||
(get-in entities [:cursor :came-from-inventory?])))
|
(get-in entities [:cursor :came-from-inventory?])))
|
||||||
((or (when (and interacting-entity (not (:cursor interaction)))
|
((or (when (and interacting-entity (not (:cursor interaction)))
|
||||||
(do (screen! hud :on-start-script)
|
(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
|
(when interaction
|
||||||
(do (screen! hud :on-start-script)
|
(do (screen! hud :on-start-script)
|
||||||
((:get-script interaction) (or (when (:cursor interaction) :main)
|
((:get-script interaction) (or (when (:cursor interaction) :main)
|
||||||
|
|||||||
Reference in New Issue
Block a user