switch room "tell" to not use string-apend
[mudsync.git] / mudsync / command.scm
index 31687389cf9a17af83e2f02e318d2f28b377100b..765962ce28dcd88defa2efbfe814f029bb5440c9 100644 (file)
@@ -18,7 +18,7 @@
 
 (define-module (mudsync command)
   #:use-module (mudsync parser)
-  #:use-module (8sync systems actors)
+  #:use-module (8sync actors)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
   #:use-module (ice-9 control)
             command-priority
 
             direct-command
-            indir-command
+            prep-indir-command
+            prep-direct-command
             loose-direct-command
-            loose-indir-command
+            loose-prep-command
             empty-command
             direct-greedy-command
             greedy-command
@@ -89,7 +90,7 @@
                 %default-priority))
 
 
-(define* (indir-command verbs action #:optional prepositions)
+(define* (prep-indir-command verbs action #:optional prepositions)
   (make-command verbs
                 cmatch-indir-obj
                 (lambda* (goes-by #:key direct-obj indir-obj preposition)
                 action
                 %high-priority))
 
-(define* (loose-indir-command verbs action #:optional prepositions)
+(define* (prep-direct-command verbs action #:optional prepositions)
+  (make-command verbs
+                cmatch-indir-obj
+                (lambda* (goes-by #:key direct-obj indir-obj preposition)
+                  (if prepositions
+                      (and
+                       (member  direct-obj goes-by)
+                       (member preposition prepositions))
+                      (member direct-obj goes-by)))
+                action
+                %high-priority))
+
+(define* (loose-prep-command verbs action #:optional prepositions)
   (make-command verbs
                 cmatch-indir-obj
                 (const #t)