PennMUSH 1.8.3p12
authorRick L Bird <nveid@yahoo.com>
Sat, 14 May 2011 17:22:46 +0000 (13:22 -0400)
committerRick L Bird <nveid@yahoo.com>
Sat, 14 May 2011 17:28:31 +0000 (13:28 -0400)
Author: talvo@talvo.com <talvo@talvo.com@ba372814-4f39-11de-9ad6-1127a62b9fcd>
Date:   Sat Jan 9 22:31:36 2010 +0000

    Issue 197 - @firstexit takes multiple exits, and works remotely
Fixes #182

hdrs/game.h
src/cmds.c
src/command.c
src/move.c

index 59bff4fe1998a7f0730ee514e6aa44b62bf3df36..6f061b6439f7407532a0d1f3b6806913db752884 100644 (file)
@@ -86,7 +86,7 @@ extern void do_drop(dbref player, const char *name);
 extern void do_enter(dbref player, const char *what);
 extern void do_leave(dbref player);
 extern void do_empty(dbref player, const char *what);
-extern void do_firstexit(dbref player, const char *what);
+extern void do_firstexit(dbref player, const char **what);
 
 /* From player.c */
 extern void do_password(dbref player, dbref cause,
index 50ac5d55768749838fcc37601679340f01459f98..7d73e492abb3ab46471acf1c6de7955ae8104a48 100644 (file)
@@ -426,7 +426,7 @@ COMMAND(cmd_find)
 
 COMMAND(cmd_firstexit)
 {
-  do_firstexit(player, arg_left);
+  do_firstexit(player, (const char **) args_left);
 }
 
 COMMAND(cmd_flag)
index 0c071b46de2e069795dfbc8051a31fef7c2f7fff..a8c8e190f619ba6c2ca6ce9d062d06cf78df5d31 100644 (file)
@@ -165,7 +165,7 @@ COMLIST commands[] = {
 
   {"@FIND", NULL, cmd_find,
    CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_NOGAGGED, NULL},
-  {"@FIRSTEXIT", NULL, cmd_firstexit, CMD_T_ANY, NULL},
+  {"@FIRSTEXIT", NULL, cmd_firstexit, CMD_T_ANY | CMD_T_ARGS, NULL},
   {"@FLAG", "ADD TYPE LETTER LIST RESTRICT DELETE ALIAS DISABLE ENABLE",
    cmd_flag,
    CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_NOGAGGED, NULL},
index 9cb0c489f67321fc075de847b0c7a322b64eae40..bd43cbc3e7c0c40af218cab633f698a103609376 100644 (file)
@@ -499,23 +499,27 @@ do_move(dbref player, const char *direction, enum move_type type)
  * \param what name of exit to promote.
  */
 void
-do_firstexit(dbref player, const char *what)
+do_firstexit(dbref player, const char **what)
 {
   dbref thing;
   dbref loc;
-  if ((thing =
-       noisy_match_result(player, what, TYPE_EXIT,
-                          MAT_ENGLISH | MAT_EXIT)) == NOTHING)
-    return;
-  loc = Home(thing);
-  if (!controls(player, loc)) {
-    notify(player, T("You cannot modify exits in that room."));
-    return;
+  int i;
+
+  for (i = 1; i < MAX_ARG && what[i]; i++) {
+    if ((thing =
+      noisy_match_result(player, what[i], TYPE_EXIT,
+                         MAT_ENGLISH | MAT_EXIT | MAT_ABSOLUTE)) == NOTHING)
+         continue;
+         loc = Home(thing);
+         if (!controls(player, loc)) {
+           notify(player, T("You cannot modify exits in that room."));
+           continue;
+         }
+         Exits(loc) = remove_first(Exits(loc), thing);
+         Source(thing) = loc;
+         PUSH(thing, Exits(loc));
+         notify_format(player, T("%s is now the first exit in %s."), Name(thing), unparse_object(player, loc));
   }
-  Exits(loc) = remove_first(Exits(loc), thing);
-  Source(thing) = loc;
-  PUSH(thing, Exits(loc));
-  notify_format(player, T("%s is now the first exit."), Name(thing));
 }