From: Rick L Bird Date: Sat, 14 May 2011 17:22:46 +0000 (-0400) Subject: PennMUSH 1.8.3p12 X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=69f25d570cab2cf65d78094a502990ce727171ee;p=cobramush.git PennMUSH 1.8.3p12 Author: talvo@talvo.com Date: Sat Jan 9 22:31:36 2010 +0000 Issue 197 - @firstexit takes multiple exits, and works remotely Fixes #182 --- diff --git a/hdrs/game.h b/hdrs/game.h index 59bff4f..6f061b6 100644 --- a/hdrs/game.h +++ b/hdrs/game.h @@ -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, diff --git a/src/cmds.c b/src/cmds.c index 50ac5d5..7d73e49 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -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) diff --git a/src/command.c b/src/command.c index 0c071b4..a8c8e19 100644 --- a/src/command.c +++ b/src/command.c @@ -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}, diff --git a/src/move.c b/src/move.c index 9cb0c48..bd43cbc 100644 --- a/src/move.c +++ b/src/move.c @@ -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)); }