Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Wrap the whole body of move in a dosync since @current-room needs ato…

…micity.
  • Loading branch information...
commit 09e982152cd4a2fbac011c69f0db1fa94aa0d2e1 1 parent 6def3ee
@technomancy authored
Showing with 9 additions and 8 deletions.
  1. +9 −8 src/mire/commands.clj
View
17 src/mire/commands.clj
@@ -13,14 +13,15 @@
(defn move
"\"♬ We gotta get out of this place... ♪\" Give a direction."
[direction]
- (let [target-name ((:exits @*current-room*) (keyword direction))
- target (rooms target-name)]
- (if target
- (dosync (alter (:inhabitants @*current-room*) disj player-name)
- (alter (:inhabitants target) conj player-name)
- (ref-set *current-room* target)
- (look))
- "You can't go that way.")))
+ (dosync
+ (let [target-name ((:exits @*current-room*) (keyword direction))
+ target (rooms target-name)]
+ (if target
+ (do (alter (:inhabitants @*current-room*) disj player-name)
+ (alter (:inhabitants target) conj player-name)
+ (ref-set *current-room* target)
+ (look))
+ "You can't go that way."))))
;; Command data
Please sign in to comment.
Something went wrong with that request. Please try again.