Skip to content
Browse files

Minor cleanup.

  • Loading branch information...
1 parent e792d4d commit 458400eaa4b3d887ebc44676cc1ea950ab8bdfd3 @sjl committed Jul 14, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/caves/core.clj
  2. +1 −1 src/caves/entities/aspects/destructible.clj
View
2 src/caves/core.clj
@@ -18,7 +18,7 @@
(defn run-game [game screen]
(loop [{:keys [input uis] :as game} game]
- (when-not (empty? uis)
+ (when (seq uis)
(if (nil? input)
(do
(draw-game game screen)
View
2 src/caves/entities/aspects/destructible.clj
@@ -7,4 +7,4 @@
(let [damaged-this (update-in this [:hp] - damage)]
(if-not (pos? (:hp damaged-this))
(update-in world [:entities] dissoc id)
- (update-in world [:entities id] assoc damaged-this)))))
+ (assoc-in world [:entities id] damaged-this)))))

3 comments on commit 458400e

@jmgimeno

I think you can do dissoc-in instead of and update-in that dissocs.

@sjl
Owner
sjl commented on 458400e Jul 14, 2012

Unfortunately dissoc-in was part of clojure.contrib, which Clojure 1.3 shitcanned (breaking everyone's code). There's no dissoc-in in core.

I could write it as a utility function, but meh.

@jmgimeno

I didn't know it. Thanks !!!

Please sign in to comment.
Something went wrong with that request. Please try again.