;; 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
(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)
#: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)))