From: Christopher Allan Webber Date: Mon, 30 Jan 2017 05:36:56 +0000 (-0600) Subject: fix prop stuff X-Git-Tag: fosdem-2017~35 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=65602269da15867401a949a5cebf3c5b330aaa0e;p=mudsync.git fix prop stuff --- diff --git a/mudsync/gameobj.scm b/mudsync/gameobj.scm index ee788ea..3957e0a 100644 --- a/mudsync/gameobj.scm +++ b/mudsync/gameobj.scm @@ -241,6 +241,7 @@ Note that this doesn't do any special dyn-ref of the location." (replace-step actor occupants)) replace-steps)))) +(define %nothing (cons '*the* '*nothing*)) (define (gameobj-setup-props gameobj) (define class (class-of gameobj)) (define props (slot-ref gameobj 'props)) @@ -250,7 +251,8 @@ Note that this doesn't do any special dyn-ref of the location." ;; and use that to build up the table (hash-for-each (lambda (key value) - (when (not (hashq-ref props key value)) ; don't override init'ed instance values + (when (eq? (hashq-ref props key %nothing) ; don't override init'ed instance values + %nothing) (hashq-set! props key value))) (rmeta-slot-cache (class-slot-ref class 'initial-props)))) @@ -269,7 +271,7 @@ Note that this doesn't do any special dyn-ref of the location." (hashq-set! (slot-ref gameobj 'props) key val)) (define* (gameobj-act-get-prop actor message key #:optional dflt) - (gameobj-get-prop actor key dflt)) + (<-reply message (gameobj-get-prop actor key dflt))) (define (gameobj-goes-by gameobj) "Find the name we go by. Defaults to #:name if nothing else provided."