Update to use #:init-thunk instead of #:init-value on actions slot
[mudsync.git] / mudsync / thing.scm
index 6963c01b985a2867f7fa89e89a12831ac50dfd70..64ceeee5a094550584d9844ebf97957ee0cf6986 100644 (file)
@@ -62,7 +62,7 @@
   (contained-commands
    #:init-value (wrap thing-contained-commands))
   (actions #:allocation #:each-subclass
-           #:init-value
+           #:init-thunk
            (build-actions
             (cmd-take thing-cmd-take)
             (cmd-drop thing-cmd-drop))))
@@ -70,9 +70,9 @@
 (define* (thing-cmd-take thing message #:key direct-obj)
   (define player (message-from message))
   (define player-name
-    (msg-val (<-wait thing player 'get-name)))
+    (mbody-val (<-wait player 'get-name)))
   (define player-loc
-    (msg-val (<-wait thing player 'get-loc)))
+    (mbody-val (<-wait player 'get-loc)))
   (define thing-name (slot-ref thing 'name))
   (define should-take
     (slot-ref-maybe-runcheck thing 'takeable player))
       ;; Set the location to whoever's picking us up
       (begin
         (gameobj-set-loc! thing player)
-        (<- thing player 'tell
+        (<- player 'tell
             #:text (format #f "You pick up ~a.\n"
                            thing-name))
-        (<- thing player-loc 'tell-room
+        (<- player-loc 'tell-room
             #:text (format #f "~a picks up ~a.\n"
                            player-name
                            thing-name)
             #:exclude player))
-      (<- thing player 'tell
+      (<- player 'tell
           #:text (format #f "It doesn't seem like you can pick up ~a.\n"
                          thing-name))))
 
 (define* (thing-cmd-drop thing message #:key direct-obj)
   (define player (message-from message))
   (define player-name
-    (msg-val (<-wait thing player 'get-name)))
+    (mbody-val (<-wait player 'get-name)))
   (define player-loc
-    (msg-val (<-wait thing player 'get-loc)))
+    (mbody-val (<-wait player 'get-loc)))
   (define thing-name (slot-ref thing 'name))
   (define should-drop
     (slot-ref-maybe-runcheck thing 'dropable player))
       ;; Set the location to whoever's picking us up's location
       (begin
         (gameobj-set-loc! thing player-loc)
-        (<- thing player 'tell
+        (<- player 'tell
             #:text (format #f "You drop ~a.\n"
                            thing-name))
-        (<- thing player-loc 'tell-room
+        (<- player-loc 'tell-room
             #:text (format #f "~a drops ~a.\n"
                            player-name
                            thing-name)
             #:exclude player))
-      (<- thing player 'tell
+      (<- player 'tell
           #:text (format #f "It doesn't seem like you can drop ~a.\n"
                          thing-name))))