From: Christopher Allan Webber Date: Wed, 4 May 2016 18:31:06 +0000 (-0500) Subject: look in rooms X-Git-Tag: fosdem-2017~186 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=1c65eb772aaa7c3a4278b95bc02660dc79c25438;p=mudsync.git look in rooms --- diff --git a/mudsync/parser.scm b/mudsync/parser.scm index 305f43d..3d84195 100644 --- a/mudsync/parser.scm +++ b/mudsync/parser.scm @@ -81,13 +81,13 @@ (sre->irregex `(: (? (: ,preposition (+ space))) ; possibly a preposition (ignored) (? (: ,article (+ space))) ; possibly an article (ignored) - (=> direct-obj (* any))))) ; direct object (kept) + (=> direct-obj (+ any))))) ; direct object (kept) (define (cmatch-direct-obj phrase) (match-to-kwargs direct-irx phrase)) (define (cmatch-empty phrase) - (if (equal? (string-trim phrase) ")") + (if (equal? (string-trim phrase) "") '() #f)) diff --git a/mudsync/room.scm b/mudsync/room.scm index 5c93be3..ddf7430 100644 --- a/mudsync/room.scm +++ b/mudsync/room.scm @@ -91,7 +91,8 @@ (build-actions ;; desc == description (wire-exits! (wrap-apply room-wire-exits!)) - (cmd-go (wrap-apply room-cmd-go)))) + (cmd-go (wrap-apply room-cmd-go)) + (cmd-look-room (wrap-apply room-cmd-look-room)))) (define room-actions* (append room-actions gameobj-actions)) @@ -129,3 +130,6 @@ claim to point to." (else (<- room (message-from message) 'tell #:text "I don't know where that is?\n")))) + +(define-mhandler (room-cmd-look-room room message) + (<- room (message-from message) 'look-room))