fixed bug that broke item interactions.

This commit is contained in:
2014-10-14 17:52:32 -07:00
parent 28ca70a1fc
commit ec87413084
2 changed files with 10 additions and 7 deletions

View File

@@ -8,7 +8,8 @@
:get-script (fn [cursor [x y]]
(if (= :main cursor)
(:script spec)
(get-in spec [:scripts cursor])))}))
(when-let [scripts (:scripts spec)]
(scripts cursor))))}))
entities (into {} (for [[id entity] entities]
[id (merge entity
{:mouse-in? (fn [entities x y]
@@ -20,7 +21,8 @@
{:get-script (fn [cursor [x y]]
(if (= :main cursor)
(:script entity)
(get-in entity [:scripts cursor])))}))]))]
(when-let [scripts (:scripts entity)]
(scripts cursor))))}))]))]
(merge params {:collision (advent.pathfind/map-from-resource collision)
:interactions interactions-as-list
:entities entities})))