X-Git-Url: https://jxself.org/git/?p=mudsync.git;a=blobdiff_plain;f=mudsync%2Fgameobj.scm;h=334f4397593054d71c744ee062e40c850909be34;hp=9d4a91380a660c04f0106e8dd557d9f669aa871f;hb=cd40c01c4ac301e7d991e4df4d17d2c693d11d05;hpb=126d9c593cc4c26082c972741ff69d3b147b7fcd diff --git a/mudsync/gameobj.scm b/mudsync/gameobj.scm index 9d4a913..334f439 100644 --- a/mudsync/gameobj.scm +++ b/mudsync/gameobj.scm @@ -127,8 +127,8 @@ ;; Kind of a useful utility, maybe? (define (simple-slot-getter slot) (lambda (actor message) - (reply-message actor message - #:val (slot-ref actor slot)))) + (<-reply actor message + #:val (slot-ref actor slot)))) (define (gameobj-replace-step-occupants actor replace-reply) (define occupants @@ -262,12 +262,13 @@ Assists in its replacement of occupants if necessary and nothing else." (format #t "DEBUG: Location set to ~s for ~s\n" loc (actor-id-actor gameobj)) - (slot-set! gameobj 'loc loc) - ;; Change registation of where we currently are - (if loc - (<-wait gameobj loc 'add-occupant! #:who (actor-id gameobj))) - (if old-loc - (<-wait gameobj old-loc 'remove-occupant! #:who (actor-id gameobj)))) + (when (not (equal? old-loc loc)) + (slot-set! gameobj 'loc loc) + ;; Change registation of where we currently are + (if old-loc + (<-wait gameobj old-loc 'remove-occupant! #:who (actor-id gameobj))) + (if loc + (<-wait gameobj loc 'add-occupant! #:who (actor-id gameobj))))) ;; @@: Should it really be #:id ? Maybe #:loc-id or #:loc? (define-mhandler (gameobj-act-set-loc! actor message loc) @@ -364,6 +365,6 @@ By default, this is whether or not the generally-visible flag is set." #:symbol special-symbol) 'val)) ;; if it's false, return nothing - ((#f #f)) + (#f #f) ;; otherwise it's probably an address, return it as-is (_ special-symbol)))