solved issue with crash for using item on itself.

This commit is contained in:
Bryce Covert
2016-06-28 08:36:23 -07:00
parent 58f270a4c4
commit bd797e60be

View File

@@ -82,11 +82,14 @@
(declare items) (declare items)
(defn mix-ingredients [base] (defn mix-ingredients [base]
(fn [other] (fn [other]
(let [is-using-flask? (seq (filter (comp :flask? items) [base other]))] (let [is-using-flask? (seq (filter (comp :flask? items) [base other]))
(if is-using-flask? items-used (set [base other])]
(cond (= 1 (count items-used))
nil
is-using-flask?
(actions/get-script entities (actions/get-script entities
(if (actions/has-item? entities :note-1) (if (actions/has-item? entities :note-1)
(condp = #{base other} (condp = items-used
#{:ash :flask-water} (make-water-and-ash entities) #{:ash :flask-water} (make-water-and-ash entities)
#{:flies :flask-water} (make-water-and-flies entities) #{:flies :flask-water} (make-water-and-flies entities)
#{:flies :flask-water-ash} (make-flies-ash entities) #{:flies :flask-water-ash} (make-flies-ash entities)
@@ -95,6 +98,7 @@
(actions/talk entities :ego "I'm not sure if that goes in there.")) (actions/talk entities :ego "I'm not sure if that goes in there."))
(actions/talk entities :ego "I should really find out from Gandarf before I put anything in there."))) (actions/talk entities :ego "I should really find out from Gandarf before I put anything in there.")))
:else
nil)))) nil))))
(def items (def items